[英]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. 如何以编程方式配置代理服务器以使用Windows应用程序在本地网络上连接到Internet。
Please suggest a good example/reference. 请提出一个很好的例子/参考。
Screenshot shows the windows application form for setting proxy server 屏幕截图显示了用于设置代理服务器的Windows应用程
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. 如果您正在使用
WebRequest
或任何实现它的东西,则可以使用WebProxy
对象。 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. 现在,您可以将此设置为Web请求或
Object.Proxy
属性下的Web服务调用。
Links: 链接:
Setting Windows internet connection proxy from C# . 从C#设置Windows Internet连接代理 。 Use this link as reference
使用此链接作为参考
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.