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

后端 未结 5 1513
时光取名叫无心
时光取名叫无心 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:42

    If you want to check for the Proxy settings in IE, you could also peek into the registry: check the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings branch of the registry tree - lots of options and settings there. Most notably: ProxyEnable (a DWORD, 0 = no proxy, 1 = proxy enabled).

提交回复
热议问题