1 回答
TA贡献1777条经验 获得超3个赞
这意味着,您的代理服务器凭据不正确,尝试解决此问题的最佳解决方案是:
首先,将此行添加到您的 Web.Config:
<system.net>
<defaultProxy useDefaultCredentials="true" >
</defaultProxy>
</system.net>
其次,是通过代码:
service.Proxy = WebRequest.DefaultWebProxy;
service.Credentials = System.Net.CredentialCache.DefaultCredentials; ;
service.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
第三,是通过代码在两个位置设置凭据:
HttpWebRequest webRequest = WebRequest.Create(uirTradeStream) as HttpWebRequest;
webRequest.Proxy = WebRequest.DefaultWebProxy;
webRequest.Credentials = new NetworkCredential("user", "password", "domain");
webRequest.Proxy.Credentials = new NetworkCredential("user", "password", "domain");
这里最适合你。
- 1 回答
- 0 关注
- 147 浏览
添加回答
举报