代码如下:
<HTA: แอปพลิเคชัน
id = "mysamplehta"
คำบรรยายภาพ = "ใช่"
Scroll = "Auto"
ชายแดน = "ไม่มี"
BorderStyle = "Static"
singleinstance = "ใช่"
MaximizeButton = "ไม่"
ชายแดน = "ไม่"
icon = "dxdiag.exe">
<title> vpn 连接程序 hta 版 </title>
<style>
ร่างกาย
-
ขนาดตัวอักษร: 12;
ความเป็นมา: #dadada;
ขอบซ้าย: 5;
-
ป้อนข้อมูล
-
ความกว้าง: 50;
ล้น: มองเห็นได้;
เส้นขอบ: 1px Solid Lightblue;
พื้นหลังสี: #CCCCCC;
เคอร์เซอร์: ข้อความ;
-
ปุ่ม
-
เส้นขอบ: 1px ของแข็งสีเทา;
ความกว้าง: 70;
ขอบซ้าย: 2;
เคอร์เซอร์: มือ;
ขนาดตัวอักษร: 12;
ตัวกรอง: progid: dximagetransform.microsoft.gradient (startColorStr = '#eaeaff', endColorStr = '#618FFF', gradientType = '0');
-
</style>
<body>
<อินพุต id = "id" size = "30" value = "mjj"> </input> <br>
<อินพุต id = "pass" size = "30" value = "mjj"> </input> <br>
<อินพุต id = "ip" size = "50" value = "vpn 的 ip"> </input> <br>
<button id = "ตกลง" onclick = vbs: conn> 链接 </button>
<button id = "nok" onclick = vbs: dconn> 断开 </button>
<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>
<ภาษาสคริปต์ = "vbscript">
ตั้งค่า oshell = createObject ("wscript.shell")
sub window_onload
window.resizeto 450,380
window.moveto 300, 300
สำเนา
สิ้นสุดย่อย
สำเนาย่อย
X ("IP"). value = me.clipboardData.getData ("ข้อความ")
Settimeout "Copy", 2000
สิ้นสุดย่อย
ฟังก์ชั่น x (obj)
ตั้งค่า 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 ........ ตกลง, 连接中"
อื่น
writef tempfile, x ("ip") ค่า
x ("url"). innerhtml = "ไฟล์ pbk 存在 ........ ตกลง, 连接中"
สิ้นสุดถ้า
x ("url"). innerhtml = oshell.exec ("rasdial pvpn" & x ("id"). ค่า & "" & x ("ผ่าน"). ค่า & " /phonebook:" & tempfile) .stdout.readall ()
สิ้นสุดย่อย
sub vpnshow
ตั้งค่า fso = createObject ("Scripting.filesystemObject")
file = "ip.txt"
set txt = fso.opentextfile (ไฟล์)
ถ้าไม่ใช่ txt.atendofstream แล้ว '先确定还没有到达结尾的位置
content = txt.readall '读取整个文件的数据
lines = แทนที่ (เนื้อหา, vbcrlf, "<br>") '将文本内分行字符 vbcrlf 换成 html 换行标记 "<br>"
x ("url"). innerhtml = บรรทัด
สิ้นสุดถ้า
สิ้นสุดย่อย
ฟังก์ชั่น findfile (str)
ตั้งค่า fso = createObject ("Scripting.filesystemObject")