代碼如下:
<! doctype html公共” - // W3C // DTD HTML 4.01 Transitional // en>
<html>
<頭>
<title>包裝文件v0.1 </title>
<meta http-equiv =“ content-type” content =“ text/html; charset = gb2312”>
<hta:應用程序
id =“軟件包文件v0.1”
applicationName =“軟件包文件v0.1”
版本=“ 0.1”
滾動=“否”
innerborder =“否”
contextMenu =“是”
字幕=“是”
圖標=“否”
ShowIntaskBar =“是”
singleSinstance =“是”
sysmenu =“是”
最大化布頓=“否”
WindowState =“正常”
導航=“是”
/>
<腳本語言=“ vbscript”>
函數轉移()
DIM文件名
filename = document.getElementById(“ srcfile”)。值
如果Len(文件名)> 0
昏暗的Oreq
'錯誤簡歷下一步
'//創建xmlhttp對象
set oreq = createObject(“ msxml2.xmlhttp”)
oreq.open“ get”,“ file://”&fileName,false
Oreq.Send
ff = oreq.responsebody
Dim U,S,KK
u = lenb(ff)
Redim KK(U-1)
對於i = 0到U-1
s = hex(ASCB(MIDB(ff,i+1,1)))))
如果len(s)<2
S =“ 0”&S
如果結束
'kk = kk&s
kk(i)= s
下一個
製作文件名,加入(KK,“”)
別的
document.getElementById(“ srcfile”)。焦點
msgbox“請選擇要壓縮的文件”,16,“提示”
如果結束
結束功能
功能製作(文件名,數據)
昏暗的HTM,文件
file = mid(filename,instrrev(文件名,“/”)+1)
htm = htm&data
Dim FSO,f
dim this_file
this_file = file&“ -pf.htm”
set fso = createObject(“ scripting.filesystemobject”)
設置f = fso.opentextfile(this_file,2,true)
F.Write HTM
msgbox“生成文件”&this_file&“ 成功!”,64,“生成”
結束功能
</script>
</head>
<車身marginleft = 0 marginright = 0 onload =“ window.resizeto 389,145”>
:<input type = file id =“ srcfile”> [br] [br]
<input type = button value =“轉換”
</body>
</html>