代码如下:
<HTA: aplicación
Id = "mySampleHta"
Subtítulos = "Sí"
Scroll = "Auto"
border = "ninguno"
BorderStyle = "estático"
SingleInstance = "Sí"
maximizeButton = "no"
Border = "no"
icon = "dxdiag.exe">
<title> vpn 连接程序 hta 版 </title>
<estilo>
cuerpo
{
tamaño de fuente: 12;
Antecedentes: #Dadada;
margen-izquierda: 5;
}
aporte
{
Ancho: 50;
desbordamiento: visible;
borde: 1px de luz sólida;
Color de fondo: #CCCCCC;
cursor: texto;
}
botón
{
borde: 1px gris sólido;
Ancho: 70;
margen-izquierda: 2;
cursor: mano;
tamaño de fuente: 12;
Filtro: progid: dximagetransform.microsoft.gradient (startColorStr = '#eaeAff', endcolorstr = '#618fff', gradiente de gradiente = '0');
}
</style>
<Body>
<input id = "id" size = "30" valor = "mjj"> </put> <br>
<input id = "pass" size = "30" valor = "mjj"> </put> <br>
<input id = "ip" size = "50" value = "VPN 的 IP"> </ input> <br>
<Button id = "OK" onClick = VBS: Conn> 链接 </botón>
<botón id = "nok" onClick = vbs: dconn> 断开 </boton>
<botón id = "ipshow" onClick = vbs: show> 当前 ip 显示 </boton>
<botón id = "vpnshow" onClick = vbs: vpnshow> vpn 列表 </boton>
<botón id = "vpnhelp" onClick = vbs: showhelp> 帮助 </boton> <br>
<div id = "url"> </div>
</body>
<Script language = "VBScript">
Establecer oshell = createObject ("wscript.shell")
Sub Window_onload
Window.resizeto 450,380
Window.moveto 300, 300
Copiar
Final
Subconta
x ("ip"). valor = me.clipboarddata.getData ("texto")
SetTimeOut "Copia", 2000
Final
Función x (obj)
Establecer x = document.getElementById (obj)
Función final
Subdconn
cmd = oshell.exec ("Rasdial /D"). stdout.readall ()
x ("url"). innerhtml = cmd
Final
Subvencion
x ("url"). innerhtml = "<br> <br> <iframe src = http: //www.ip138.com/ip2city.asp> </iframe>"
Final
Sub Conn
tempfile = "c:/tmp ~ 386"
Si finkFile (tempfile) = false entonces
writef tempfile, x ("ip"). valor
x ("url"). innerhtml = "Crear archivo PBK ........ OK , 连接中"
Demás
writef tempfile, x ("ip"). valor
x ("url"). innerhtml = "archivo pbk 存在 ........ ok , 连接中"
Final si
x ("url"). innerhtml = oshell.exec ("Rasdial Pvpn" & x ("id"). Value & "" & X ("pase"). Valor & " /Phonebook:" & Tempfile) .stdout.readall ()
Final
Sub vpnshow
Establecer fso = createObject ("scripting.filesystemObject")
File = "ip.txt"
Establecer txt = fso.opentextfile (archivo)
Si no txt.atendofstream entonces '先确定还没有到达结尾的位置
Content = txt.readall '读取整个文件的数据
Líneas = reemplazar (contenido, vbcrlf, "<br>") '将文本内分行字符 vbcrlf 换成 html 换行标记 "<br>"
x ("url"). innerhtml = líneas
Final si
Final
Función findfile (str)
Establecer fso = createObject ("scripting.filesystemObject")