代码如下 :
<HTA : 응용 프로그램
id = "mysamplehta"
캡션 = "예"
스크롤 = "자동"
국경 = "없음"
Borderstyle = "정적"
SingleInstance = "예"
maximizebutton = "no"
국경 = "아니오"
iCon = "dxdiag.exe">
<title> vpn v hta 版 </title>
<스타일>
몸
{
글꼴 크기 : 12;
배경 : #Dadada;
왼쪽 마진 : 5;
}
입력
{
너비 : 50;
오버플로 : 가시;
국경 : 1px Solid Lightblue;
배경색 : #CCCCCC;
커서 : 텍스트;
}
단추
{
테두리 : 1px 단단한 회색;
너비 : 70;
마진 왼쪽 : 2;
커서 : 손;
글꼴 크기 : 12;
필터 : progid : dximagetransform.microsoft.gradient (startColorstr = '#eaeaff', endcolorstr = '#618fff', gradientType = '0');
}
</스타일>
<body>
<입력 id = "id"size = "30"value = "mjj"> </input> <br>
<입력 id = "Pass"size = "30"value = "mjj"> </input> <br>
<입력 id = "IP"size = "50"value = "vpn 的 it"> </input> <br>
<button id = "Ok"onclick = vbs : conn> 链接 </button>
<button id = "nok"onclick = vbs : dconn> </button>
<버튼 id = "ipshow"onclick = vbs : show> 当前 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")
서브 window_onload
Window.Resizeto 450,380
Window.Moveto 300, 300
복사
종료 서브
서브 카피
x ( "ip"). value = me.clipboarddata.getData ( "text")
Settimeout "Copy", 2000
종료 서브
함수 X (OBJ)
set x = document.getElementById (OBJ)
엔드 기능
하위 dconn
cmd = oshell.exec ( "rasdial /d"). stdout.readall ()
x ( "url"). innerhtml = cmd
종료 서브
하위 쇼
x ( "url"). innerhtml = "<br> <br> <iframe src = http : //www.ip138.com/ip2city.asp> </iframe>"
종료 서브
Sub Conn
tempfile = "c :/tmp ~ 386"
findfile (tempfile) = false 인 경우
writef tempfile, x ( "ip"). 값
x ( "url"). innerhtml = "pbk 파일 생성 ........ OK, 连接中"
또 다른
writef tempfile, x ( "ip"). 값
x ( "url"). innerhtml = "PBK 파일 存在 ........ OK, 连接中"
끝 If
x ( "url"). innerhtml = oshell.exec ( "rasdial pvpn"& x ( "id"). value & ""& x ( "pass"). value & " /phonebook :"& tempfile) .stdout.readall ()
종료 서브
하위 vpnshow
set fso = createobject ( "scripting.filesystemobject")
file = "ip.txt"
set txt = fso.opentextfile (파일)
txt.atendofstream이 아닌 경우 '先确定还没有到达结尾的位置
content = txt.readall '读取整个文件的数据
lines = replace (content, vbcrlf, "<br>") '将文本内分行字符 vbcrlf 换成 html 换行标记 "<br>"
x ( "url"). innerhtml = line
끝 If
종료 서브
함수 findfile (str)
set fso = createobject ( "scripting.filesystemobject")