如何改变局域网设置(代理配置)编程局域网

2023-09-03 13:17:03 作者:予我长情

我写一个程序基于我连接到网络上的自动切换我的代理服务器地址。

I am writing a program to automatically switch my proxy address based on the network I am connected to.

我至今得到的一切工作,除了我下面突出的部分。

I have so far got everything to work except the part that I have highlighted below.

有没有办法来改变自动配置脚本和code中的自动检测设置?

Is there any way to change the automatic configuration script and the automatically detect settings in code?

该溶液可以是P /调用注册表编辑。我只是需要一些作品。

The solution can be either P/Invoke registry editing. I just need something that works.

推荐答案

您可以通过使用注册表更改代理设置。请访问以下链接: http://support.microsoft.com/kb/819961

You can change proxy settings by using the registry. See the following link: http://support.microsoft.com/kb/819961

关键路径: HKEY_CURRENT_USER \软件\微软\的Windows \ CurrentVersion \ Internet设置

值:

"MigrateProxy"=dword:00000001
"ProxyEnable"=dword:00000001
"ProxyHttp1.1"=dword:00000000
"ProxyServer"="http://ProxyServername:80"
"ProxyOverride"="<local>"

A question在SuperUser.com 有关如何禁用自动检测IE代理的配置设置。禁用自动检测设置,在IE浏览器的代理配置。

A question in SuperUser.com regarding how to disable automatically detect settings in ie proxy configuration. Disable "Automatically detect settings" in IE proxy configuration

有一个片段,从通过注册的Internet Explorer自动配置脚本定义。

A snippet, taken from Internet Explorer Automatic Configuration Script Definition via Registry.

脚本1:这使得Autoconf脚本,并确定它是什么(交换的http:// XXXX 与你的脚本)

Script 1: This enables the AutoConf Script and defines what it is (exchange the http://xxxx with your script)

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"AutoConfigURL"="http://xxx.xxx.xxx.xxx.xxxx"
"ProxyEnable"=dword:00000000

脚本2:这个脚本禁用Autoconf脚本并启用代理服务器例外

Script 2: This script Disables the AutoConf Script and enables a proxy server with exceptions.


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyOverride"="proxyexceptionname:portnumber;anotherexceptionname:port
"ProxyServer"="ftp=MyFTPProxy:Port;http=MYHTTPPROXY:PORT;https=MYHTTPSPROXY:PORT
"AutoConfigURL"=""