简体   繁体   English

如何以编程方式配置代理服务器以使用Windows应用程序在本地网络上连接到Internet

[英]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.

相关问题 如何在非本地网络上以编程方式通过 Internet 连接 windows 和 android 设备 - How to connect windows and android device over internet programmatically on Non-Local network 特定网络接口IPv4可用性 - 无连接,本地,Internet - Specific network interface IPv4 availability - No connectivity, Local, Internet 以编程方式断开网络连接 - Programmatically disconnect network connectivity 如何从Internet访问本地网络中的服务器 - how to access server within local network from internet 如何以编程方式将Azure ServiceBus侦听器配置为“自动检测”连接模式? - How to programmatically configure Azure ServiceBus listener for 'AutoDetect' connectivity mode? 如何在.Net应用程序中配置代理 - how to configure proxy in .Net application 如何在通用 Windows 平台中检查 Internet 连接类型 - How to check internet connectivity type in Universal Windows Platform 代理服务器如何位于本地? - how a proxy server can be local? 如何以编程方式配置已安装的Windows服务 - How to programmatically configure an installed Windows service 以编程方式使用免费代理服务器连接到网站 - connect to website using a free proxy server programmatically
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM