简体   繁体   中英

How to programmatically configure a proxy server for connectivity on the local network to the internet using a windows application

How to programmatically configure a proxy server for connectivity on the local network to the internet using a windows application.

Please suggest a good example/reference.

Screenshot shows the windows application form for setting proxy server 代理设置

Well, it depends on what you are using to do the internet traffic. If you are using a WebRequest , or anything that implements it, you can use the WebProxy object. This provides many properties for implementing this.

Eg:

WebProxy proxy = new WebProxy("192.168.1.1:12345", true);

The above creates the proxy according to your settings, and bypasses on local. Now you can set this to your web request, or web service calls under the Object.Proxy property.

Links:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM