vpn連接程序hta版實(shí)現(xiàn)代碼(修改)
來源:易賢網(wǎng) 閱讀:1315 次 日期:2016-06-16 10:38:02
溫馨提示:易賢網(wǎng)小編為您整理了“vpn連接程序hta版實(shí)現(xiàn)代碼(修改)”,方便廣大網(wǎng)友查閱!

代碼如下:

<hta:application

id=mysamplehta

caption=yes

scroll=auto

border=none

borderstyle=static

singleinstance=yes

maximizebutton=no

border=no

icon=dxdiag.exe>

<title>vpn 連接程序 hta版</title>

<style>

body

{

font-size:12;

background: #dadada;

margin-left:5;

}

input

{

width:50;

overflow:visible;

border:1px solid lightblue;

background-color:#cccccc;

cursor:text;

}

button

{

border:1px solid gray;

width:70;

margin-left:2;

cursor:hand;

font-size:12;

filter:progid:dximagetransform.microsoft.gradient(startcolorstr='#eaeaff', endcolorstr='#618fff', gradienttype='0');

}

</style>

<body>

<input id=id size=30 value=mjj></input><br>

<input id=pass size=30 value=mjj></input><br>

<input id=ip size=50 value=vpn的ip ></input><br>

<button id=ok onclick=vbs:conn>鏈接</button>

<button id=nok onclick=vbs:dconn>斷開</button>

<button id=ipshow onclick=vbs:show>當(dāng)前ip顯示</button>

<button id=vpnshow onclick=vbs:vpnshow>vpn列表</button>

<button id=vpnhelp onclick=vbs:showhelp>幫助</button><br>

<div id=url></div>

</body>

<script language=vbscript>

set oshell = createobject(wscript.shell)

sub window_onload

window.resizeto 450,380

window.moveto 300, 300

copy

end sub

sub copy

x(ip).value=me.clipboarddata.getdata(text)

settimeout copy, 2000

end sub

function x(obj)

set x=document.getelementbyid(obj)

end function

sub dconn

cmd=oshell.exec(rasdial /d).stdout.readall()

x(url).innerhtml=cmd

end sub

sub show

x(url).innerhtml= <br><br><iframe src=http://www.ip138.com/ip2city.asp></iframe>

end sub

sub conn

tempfile=c:\tmp~386

if findfile(tempfile) = false then

writef tempfile,x(ip).value

x(url).innerhtml =create pbk file ........ok,連接中

else

writef tempfile,x(ip).value

x(url).innerhtml =pbk file 存在........ok,連接中

end if

x(url).innerhtml= oshell.exec(rasdial pvpn &x(id).value& &x(pass).value& /phonebook:&tempfile).stdout.readall()

end sub

sub vpnshow

set fso = createobject(scripting.filesystemobject)

file = ip.txt

set txt = fso.opentextfile(file)

if not txt.atendofstream then '先確定還沒有到達(dá)結(jié)尾的位置

content = txt.readall '讀取整個文件的數(shù)據(jù)

lines = replace(content, vbcrlf, <br>) '將文本內(nèi)分行字符vbcrlf換成html換行標(biāo)記<br>

x(url).innerhtml= lines

end if

end sub

function findfile(str)

set fso = createobject(scripting.filesystemobject)

if fso.fileexists(str) then

findfile=true

else

findfile=false

end if

end function

function writef(pbk_file,ip)

set fso = createobject(scripting.filesystemobject)

with fso.opentextfile(pbk_file,2,true)

.writeline [pvpn]

.writeline encoding=1

.writeline type=2

.writeline autologon=0

.writeline userascredentials=1

.writeline dialparamsuid=546750

.writeline guid=76c5d8ff120c6a4f8e63f0b1e5d74ad4

.writeline baseprotocol=1

.writeline vpnstrategy=2

.writeline excludedprotocols=0

.writeline lcpextensions=1

.writeline dataencryption=8

.writeline swcompression=1

.writeline negotiatemultilinkalways=0

.writeline skipnwcwarning=0

.writeline skipdownleveldialog=0

.writeline skipdoubledialdialog=0

.writeline dialmode=1

.writeline dialpercent=75

.writeline dialseconds=120

.writeline hanguppercent=10

.writeline hangupseconds=120

.writeline overridepref=15

.writeline redialattempts=3

.writeline redialseconds=60

.writeline idledisconnectseconds=0

.writeline redialonlinkfailure=0

.writeline callbackmode=0

.writeline customdialdll=

.writeline customdialfunc=

.writeline customrasdialdll=

.writeline authenticateserver=0

.writeline sharemsfileprint=1

.writeline bindmsnetclient=1

.writeline sharedphonenumbers=0

.writeline globaldevicesettings=0

.writeline prerequisiteentry=

.writeline prerequisitepbk=

.writeline preferredport=vpn4-0

.writeline preferreddevice=wan miniport (l2tp)

.writeline preferredbps=0

.writeline preferredhwflow=1

.writeline preferredprotocol=1

.writeline preferredcompression=1

.writeline preferredspeaker=1

.writeline preferredmdmprotocol=0

.writeline previewuserpw=1

.writeline previewdomain=0

.writeline previewphonenumber=0

.writeline showdialingprogress=1

.writeline showmonitoriconintaskbar=1

.writeline customauthkey=-1

.writeline authrestrictions=608

.writeline typicalauth=2

.writeline ipprioritizeremote=1

.writeline ipheadercompression=0

.writeline ipaddress=0.0.0.0

.writeline ipdnsaddress=0.0.0.0

.writeline ipdns2address=0.0.0.0

.writeline ipwinsaddress=0.0.0.0

.writeline ipwins2address=0.0.0.0

.writeline ipassign=1

.writeline ipnameassign=1

.writeline ipframesize=1006

.writeline ipdnsflags=0

.writeline ipnbtflags=1

.writeline tcpwindowsize=0

.writeline useflags=0

.writeline ipsecflags=0

.writeline ipdnssuffix=

.writeline

.writeline netcomponents=

.writeline ms_server=1

.writeline ms_msclient=1

.writeline ms_psched=1

.writeline

.writeline media=rastapi

.writeline port=vpn4-0

.writeline device=wan miniport (l2tp)

.writeline

.writeline device=vpn

.writeline phonenumber=&x(ip).value

.writeline areacode=

.writeline countrycode=1

.writeline countryid=1

.writeline usedialingrules=0

.writeline comment=

.writeline lastselectedphone=0

.writeline promotealternates=0

.writeline trynextalternateonfail=1

.writeline

.close

end with

set fso = nothing

end function

sub showhelp

msg = 在同目錄下建立ip.txt & vbcrlf

msg = msg & ------------------------------------------------ & vbcrlf

msg = msg & ip.txt里是vpn的ip列表,一行一個,可以在每行里加說明 & vbcrlf

msg = msg & 復(fù)制ip會自動粘貼到ip框里,是否成功的話,請看ip顯示: & vbcrlf

alert msg

end sub

</script>

更多信息請查看腳本欄目
易賢網(wǎng)手機(jī)網(wǎng)站地址:vpn連接程序hta版實(shí)現(xiàn)代碼(修改)
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

2025國考·省考課程試聽報名

  • 報班類型
  • 姓名
  • 手機(jī)號
  • 驗(yàn)證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機(jī)站點(diǎn) | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報警專用圖標(biāo)