1

I have read so many posts, forums and question regarding proxy settings but still cannot find what I am looking for. Most of the proxy related articles are too old or deprecated.

Very simple:

I can set all the settings I would like to regarding the proxy BUT I cant find a way to display the current proxy settings.

I would like to retrieve the proxy server name/address and the port number.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
Solx85
  • 244
  • 2
  • 16
  • So you basically want to set the `Proxy` of your `WebRequest` to the actual Windows default one? If so you can use `WebRequest.DefaultWebProxy` – Sorashi Oct 19 '15 at 17:34
  • No, I want to retrieve the current proxy settings as it is. Just to allow me to display the current settings in a GUI – Solx85 Oct 19 '15 at 17:39
  • 2
    There is no [global proxy settings](http://superuser.com/questions/29701/global-proxy-settings-for-windows). You have to be looking for a specific one. If you want to get information about IE proxy settings, then you can use `WebProxy wp = WebRequest.DefaultWebProxy` – Sorashi Oct 19 '15 at 17:45
  • Cannot implicitly convert type 'System.Net.IWebProxy' to 'System.Net.WebProxy'. An explicit conversion exists (are you missing a cast?) – Solx85 Oct 19 '15 at 17:52
  • You have to cast the type to `WebProxy`. Sorry, I forgot about that. My fault. `WebProxy wp =(WebProxy)WebRequest.DefaultWebProxy;` – Sorashi Oct 19 '15 at 17:54
  • Sorry, I dont have a lot of experience. "Unable to cast object of type 'WebProxyWrapper' to type 'System.Net.WebProxy'." – Solx85 Oct 19 '15 at 17:59
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/92760/discussion-between-kazarp-and-solx85). – Sorashi Oct 19 '15 at 18:02

0 Answers0