代码如下:
<HTA: application
Id = "mysamplehta"
Légende = "Oui"
Scroll = "auto"
Border = "Aucun"
borderstyle = "statique"
Singleinstance = "Oui"
maximiserbutton = "no"
Border = "non"
icon = "dxdiag.exe">
<Title> VPN 连接程序 HTA 版 </TITLE>
<style>
corps
{
taille de police: 12;
Contexte: #dadada;
marge-gauche: 5;
}
saisir
{
Largeur: 50;
débordement: visible;
Border: 1px Solid LightBlue;
Color d'arrière-plan: #CCCCCC;
curseur: texte;
}
bouton
{
Border: 1px gris massif;
Largeur: 70;
marge-gauche: 2;
curseur: main;
taille de police: 12;
Filtre: PROGID: dxiagetransform.microsoft.gradient (startColorstr = '# eaeaff', endColorstr = '# 618fff', gradientType = '0');
}
</ style>
<body>
<input id = "id" size = "30" value = "mjj"> </ entrée> <br>
<input id = "pass" size = "30" value = "mjj"> </ entrée> <br>
<input id = "ip" size = "50" value = "vpn 的 ip"> </put> <br>
<Button id = "OK" onClick = VBS: Conn> 链接 </ Button>
<Button id = "nok" onclick = vbs: DConn> 断开 </futton>
<Button id = "ipshow" onclick = vbs: show> 当前 ip 显示 </futton>
<Button id = "vpnshow" onclick = vbs: vpnshow> vpn 列表 </futton>
<Button id = "vpnhelp" onclick = vbs: showhelp> 帮助 </futton> <br>
<div id = "url"> </ div>
</docy>
<Script linguisse = "vbscript">
Définir Oshell = CreateObject ("wscript.shell")
Sub window_onload
Window.Resizeto 450,380
fenêtre.moveto 300, 300
copie
Sub-Sub
Inférieur
x ("ip"). valeur = me.clipboarddata.getData ("texte")
Settimeout "Copy", 2000
Sub-Sub
Fonction X (OBJ)
Set x = document.getElementByid (obj)
Fonction finale
Sous
cmd = oshell.exec ("rasdial / d"). stdout.readall ()
x ("url"). innerhtml = cmd
Sub-Sub
Sous-spectacle
x ("url"). innerhtml = "<br> <br> <iframe src = http: //www.ip138.com/ip2city.asp> </ iframe>"
Sub-Sub
Suborn
tempfile = "c: / tmp ~ 386"
Si findfile (tempfile) = false alors
writef tempfile, x ("ip").
x ("url"). innerhtml = "Créer un fichier pbk ........ ok , 连接中"
Autre
writef tempfile, x ("ip").
x ("url"). innerhtml = "fichier pbk 存在 ........ ok , 连接中"
Terminer si
x ("url"). innerhtml = oshell.exec ("rasdial pvpn" & x ("id"). valeur & "" & x ("pass").
Sub-Sub
Sous-vpnshow
Set fso = createObject ("scripting.fileSystemObject")
File = "ip.txt"
Set txt = fso.opentextfile (fichier)
Si pas txt.atendofstream alors '先确定还没有到达结尾的位置
Contenu = txt.readall '读取整个文件的数据
Lignes = remplacer (contenu, vbcrlf, "<br>") '将文本内分行字符 vbcrlf 换成 html 换行标记 "<br>"
x ("url"). innerhtml = lignes
Terminer si
Sub-Sub
Fonction FindFile (str)
Set fso = createObject ("scripting.fileSystemObject")