How do I determine (elegantly) if proxy authentication is required in C# winforms app

后端 未结 5 1533
时光取名叫无心
时光取名叫无心 2020-12-28 08:49

My use case is this, I want to call out to a webservice and if I am behind a proxy server that requires authentication I want to just use the default credentials...

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-28 09:51

    System.Net.WebProxy has a property called UseDefaultCredentials that may be what you want (but I have to admit a bit of ignorance here). The link to the relevant documentation is here.

提交回复
热议问题