|
Nov
28
|
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | 'on error resume next 'msgbox "All these settings are aviable till the browser restarted!",vbInformation,"ProxyShift" dim ws,pe,proxy,proxy1,proxycount,i,r const REGDIR="HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settings" Set ws = WScript.CreateObject("WScript.Shell") readValues if pe=0 then if msgbox("Proxy is disabled, enable it?",vbYesNo,"ProxyShift")=vbYes then if proxy="" then proxy=InputBox("Input proxy server","ProxyShift") if proxy<> "" then ws.RegWrite REGDIR & "ProxyServer",proxy,"REG_SZ" ws.RegWrite REGDIR & "ProxyServer1",proxy,"REG_SZ" ws.RegWrite REGDIR & "ProxyCount","1","REG_SZ" end if else Call ChangeProxy end if ws.RegWrite REGDIR & "ProxyEnable",1,"REG_DWORD" msgbox "ProxyServer setted!",vbInformation,"ProxyShift" end if else r=msgbox("Proxy server list: " & vbcrlf & vbcrlf & get_Proxystr & vbcrlf & "Disable or change it?" & vbcrlf & vbcrlf & "[YES] for disable, [NO] for change",vbYesNoCancel,"ProxyShift") if r=vbYes then ws.RegWrite REGDIR & "ProxyEnable",0,"REG_DWORD" msgbox "Proxy disabled!",vbInformation,"ProxyShift" elseif r=vbNo then Call ChangeProxy msgbox "ProxyServer setted!",vbInformation,"ProxyShift" end if end if Function get_Proxystr dim proxystr proxystr="" proxy=ws.RegRead(REGDIR & "ProxyServer") proxycount=ws.RegRead(REGDIR & "ProxyCount") for i=1 to proxycount proxy1=ws.RegRead(REGDIR & "ProxyServer" & i) if proxy1 = "" then proxy1 = proxy proxystr=proxystr & i ". " & proxy1 if proxy1=proxy then proxystr = proxystr & " (DEFAULT)" proxystr=proxystr & vbcrlf next get_Proxystr=proxystr end Function sub ChangeProxy dim pindex r=msgbox("Proxy server list:" & vbcrlf & vbcrlf & get_Proxystr & vbcrlf & "Change the DEFAULT proxy server?" & vbcrlf & vbcrlf & "[YES] for change, [NO] for a new proxy server, [CANCEL] for use default", vbYesNoCancel,"ProxyShift") if r=vbYes then pindex=InputBox("Input proxy server index","ProxyShift") ws.RegWrite REGDIR & "ProxyServer",ws.RegRead(REGDIR & "ProxyServer" & pindex),"REG_SZ" msgbox "Proxy server " & pindex & " set as default!",vbInformation,"ProxyShift" elseif r=vbNo then dim newserver newserver=InputBox("Input a new proxy server:","ProxyShift") if newserver<>"" then ws.RegWrite REGDIR & "ProxyServer",newserver,"REG_SZ" ws.RegWrite REGDIR & "ProxyServer" & proxycount+1,newserver,"REG_SZ" ws.RegWrite REGDIR & "ProxyCount",proxycount+1,"REG_SZ" 'msgbox "ProxyServer setted!",vbInformation,"ProxyShift" end if end if end sub sub readValues on error resume next proxy=ws.RegRead(REGDIR & "ProxyServer") proxycount=ws.RegRead(REGDIR & "ProxyCount") if isnull(proxycount) or proxycount="" then ws.RegWrite REGDIR & "ProxyServer1",proxy,"REG_SZ" ws.RegWrite REGDIR & "ProxyCount","1","REG_SZ" end if proxycount=ws.RegRead(REGDIR & "ProxyCount") pe=ws.RegRead(REGDIR & "ProxyEnable") end sub |
这篇文章来自 迷途知返(PWWANG.COM), 转载请注明出处。 版权说明
Leave a comment
| Trackback

