问题描述
- C# Proxy request.GetResponse()报错 需要代理身份验证,请问要怎么写验证
-
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strUrl); response = request.GetResponse(); stream = response.GetResponseStream(); if (!response.ContentType.ToLower().StartsWith("text/")) value = SaveBinaryFile(response, path);
到response = request.GetResponse(); 的时候报错:System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
strURL = http://ac-ay44yffl.clouddn.com/lGVSCnNtEVQLsDRDuswd6JEFEJ32xn99TV8XinYY.jpeg
要在response 前面添加代理吗? 要怎么写呢 ?
解决方案
在配置文件里加上这个、""
""
""
""
时间: 2024-10-27 21:58:27