给段JavaScript的程序:
var WSHShell = WScript.CreateObject("WScript.Shell");
if(WSHShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable")==1)
{
WSHShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable",0,"REG_DWORD");
WSHShell.Popup("Now the proxy server are disabled!");
}
else
{
WSHShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable",1,"REG_DWORD");
WSHShell.Popup("Now the proxy server are enabled!");
}
把其保存为proxy.js双击。
var WSHShell = WScript.CreateObject("WScript.Shell");
if(WSHShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable")==1)
{
WSHShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable",0,"REG_DWORD");
WSHShell.Popup("Now the proxy server are disabled!");
}
else
{
WSHShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable",1,"REG_DWORD");
WSHShell.Popup("Now the proxy server are enabled!");
}
把其保存为proxy.js双击。
解决方案 »
- 请用哪种报表可以实现,合并相同的记录呢?
- 800分求,排课系统,算法
- 程序里如何实现Access里的部分功能!
- 新手问题:如何取得打开后处理再关闭的窗口中的控件内容(窗口没有释放时)
- 在STRINGGRID的CELL里怎样一格输入两行字?
- 急呀大侠们你们知道怎么取得局域网中安有数据库的机器名及数据库名(SQL Server2000)
- 如何将image中的图转换成灰度图!!!然后如何转换成ascii字符画?急救!
- How to convert the Widestring to String?
- 中青队输了,今晚中国队会输吗?
- 求救!汉字转化拼音的问题!
- DELPHI怎么连SQL?
- qtintf.dll这个文件是用来做什么的?
更改IE代理服务器设置,不重新启动IE,代码如下:
但如何设置某种协议为一特定地址呢,BYPASS参数怎么用?
其实在proxyserver中http=205.207.118.51:80;https=205.207.118.51:80;gopher=205.207.118.51:80;socks=205.207.118.51:80是分别设置,如果只有地址和端口则是所有协议使用相同地址
///Coder:Kingron
function ChangeProxy(const Proxy, Port,ByPass: string; const bEnabled: boolean = True): boolean;
var
reg: Tregistry;
info: INTERNET_PROXY_INFO;
Fproxy:string;
begin
Result := False;
FProxy:=Format('%s:%s',[Proxy,Port]);
reg := Tregistry.Create;
try
reg.RootKey := HKEY_CURRENT_USER;
if reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Internet Settings', True) then
begin
reg.Writestring('ProxyServer', Fproxy);
reg.WriteInteger('ProxyEnable', integer(bEnabled));
info.dwAccessType := INTERNET_OPEN_TYPE_PROXY;
info.lpszProxy := pchar(proxy);
info.lpszProxyBypass := pchar(ByPass);
InternetSetOption(nil, INTERNET_OPTION_PROXY, @info, SizeOf(Info));
InternetSetOption(nil, INTERNET_OPTION_SETTINGS_CHANGED, nil, 0);
// InternetSetOption(nil, INTERNET_OPTION_REFRESH, nil, 0);
// Sendmessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0);
Result:=True;
end
finally
reg.CloseKey;
reg.free;
end;
end;