.NET client app: how to get to web services in case of a proxy server?

We are developing a winform.NET 2.0 application. The application must access the web services . However, we run into problems with users behind proxies.

Popular Windows backup applications (I think Mozy ) provide a moderately sophisticated proxy settings dialog box. However, reimplementing yet another proxy and GUI logic seems like a waste of time for me.

What are the best ways to work with a proxy server with .NET client applications?

More specifically, we have a case where a user has written their proxy settings in Internet Explorer (including username and password), so the default .NET proxy behavior should work. However, the user still asks for his username and password when starting IE (both fields are pre-filled, the user just needs to click "OK"), and our winform application still does not work when processing proxies.

What should we do to ensure that the user is not prompted for a username and password when starting IE?

+3
source share
7 answers

Put this in the application configuration file:

<configuration>
  <system.net>
    <defaultProxy>
      <proxy autoDetect="true" />
    </defaultProxy>
  </system.net>
</configuration>

- IE. - IE -, "" .

+11

WebProxy WebRequest. , .

+2

.NET WebProxy. .

+1

- - IE Explorer.

0

IE, "" -, ( IE open) winforms, ? -, ?

0

, -, (.. -)?

0

, , WebProxy, -, , " - IE, ?"

System.Net.WebProxy.GetDefaultProxy is deprecated, you need to use System.Net.WebRequest.DefaultWebProxy. There is an article describing it at http://msdn.microsoft.com/en-ca/magazine/cc300743.aspx .

0
source

Source: https://habr.com/ru/post/1697459/


All Articles