The following code works for me:
var webProxy = WebProxy.GetDefaultProxy();
webProxy.UseDefaultCredentials = true;
WebRequest.DefaultWebProxy = webProxy;
Unfortunately, WebProxy.GetDefaultProxy()
is deprecated. What else should I be doing?
(using app.config to set the defaultProxy settings is not allowed in my deployment)
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…