如何改变局域网设置(代理配置)编程 [英] How to change LAN Settings (proxy configuration) programmatically

查看:1117
本文介绍了如何改变局域网设置(代理配置)编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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 <一个href="http://superuser.com/questions/79703/disable-automatically-detect-settings-in-ie-proxy-configuration">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

有一个片段,从<一取href="http://www.google.com/url?sa=t&source=web&cd=3&ved=0CCIQFjAC&url=http%3A%2F%2Fwww.experts-exchange.com%2FSoftware%2FInternet_Email%2FWeb_Browsers%2FInternet_Explorer%2FQ_23300941.html&ei=x6acTZC3N8y5hAeJ6bzhBg&usg=AFQjCNGokIQF2y9Ptov92F2CiiGaQ2H5uA"相对=nofollow>通过注册的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"=""

这篇关于如何改变局域网设置(代理配置)编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆