濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > XMLDOM下載者生成器代碼(xmldown.hta)

XMLDOM下載者生成器代碼(xmldown.hta)

熱門標(biāo)簽:不錯(cuò)的400電話辦理 獲客智能電銷機(jī)器人 南昌辦理400電話怎么安裝 哈爾濱外呼系統(tǒng)代理商 佛山防封外呼系統(tǒng)收費(fèi) 湛江電銷防封卡 鄭州智能外呼系統(tǒng)運(yùn)營(yíng)商 電話機(jī)器人適用業(yè)務(wù) 徐州天音防封電銷卡
以下代碼保存成hta文件,可生成js和vbs下載者
復(fù)制代碼 代碼如下:

HTA:APPLICATION
ID="xmldown"
Caption="yes"
SCROLL="auto"
border="none"
borderStyle="static"
SINGLEINSTANCE="yes"
maximizebutton="no"
BORDER="no"
icon="dxdiag.exe">
script language=vbs>

Sub Window_onLoad
window.resizeTo screen.width/1.6,screen.height/3
window.moveTo 200,200

End Sub

Sub CreateXml(path,File)

Set objStream = CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open()
objStream.LoadFromFile(Path)
objStream.position = 0

Set XmlDoc = CreateObject("Microsoft.XMLDOM")
XmlDoc.async = False
Set Root = XmlDoc.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'")
XmlDoc.appendChild(Root)
XmlDoc.appendChild(XmlDoc.CreateElement("root"))
Set Xfile = XmlDoc.SelectSingleNode("http://root").AppendChild(XmlDoc.CreateElement("file"))
Set Xstream = Xfile.AppendChild(XmlDoc.CreateElement("stream"))
Xstream.SetAttribute "xmlns:dt", "urn:schemas-microsoft-com:datatypes"
Xstream.dataType = "bin.base64"
Xstream.nodeTypedValue = objStream.Read()
XmlDoc.Save(File)
Set XmlDoc = Nothing
Set Root = Nothing
Set objStream=Nothing


End Sub

Function x(obj)
Set x=document.getElementById(obj)
End function

Function Findfile(str)
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(str) Then
findfile=true
Else
findfile=false
End If
End Function

Function jsdown()
Set FSO = CreateObject("Scripting.FileSystemObject")
with fso.opentextfile((CreateObject("WScript.Shell")).CurrentDirectory"\jsdown.js",2,true)
.write x("jsdown").value
end with
end function

Function vbsdown()
Set FSO = CreateObject("Scripting.FileSystemObject")
with fso.opentextfile((CreateObject("WScript.Shell")).CurrentDirectory"\vbsdown.vbs",2,true)
.write x("vbsdown").value
end with
end function
/script>
body>
h4>1.生成下載用的xml文件/h4>
選擇下載的exe文件:input type=file name="file1" id="file1" size="20">
保存路徑 input type=text name="path" id="pathname" value="c:\down.xml" size="20">
input type="button" value="生成xml文件" onclick='vbs:CreateXml x("file1").value,x("pathname").value:If Findfile(x("pathname").value) = true Then msgbox("生成成功,請(qǐng)傳到某個(gè)空間"):x("url").innerHTML="font color=red>生成成功,請(qǐng)傳到某個(gè)空間/font>"'> br>
h4>2.生成下載者/h4>
button onclick='vbs:jsdown():If Findfile("jsdown.js") = true Then msgbox "生成成功":x("url").innerHTML="用法是cscript jsdown.js xmlurl savepath"' >生成js下載者/button>button onclick='vbs:vbsdown():If Findfile("vbsdown.vbs") = true Then msgbox "生成成功":x("url").innerHTML="font color=blue>用法是cscript vbsdown.js xmlurl savepath/font>"'>生成vbs下載者/button>br>br>br>br>
div id="url">/div>

textarea style="visibility:hidden" name=jswodn id=jsdown rows="1" cols="1">
var objArgs = WScript.Arguments;
var objXmlFile =new ActiveXObject("Microsoft.XMLDOM");
objXmlFile.async=false;
objXmlFile.load(objArgs(0).toLowerCase());
do
{
WScript.sleep(100);
}
while (!objXmlFile.readyState == 4)

if (objXmlFile.readyState == 4)
{
var objStream = new ActiveXObject("ADODB.Stream")
var objNodeList =objXmlFile.getElementsByTagName("stream")[0].nodeTypedValue

with(objStream)
{
objStream.Type = 1;
objStream.Open();
objStream.Write(objNodeList);
objStream.SaveToFile(objArgs(1).toLowerCase(),2);
objStream.close();
}
}

delete objXmlFile;
delete objStream;

/textarea>

textarea style="visibility:hidden" name=vbswodn id=vbsdown rows="1" cols="1">
Set objXmlFile = CreateObject("Microsoft.XMLDOM")
objXmlFile.async=false
objXmlFile.load(Wscript.arguments(0))
Do While objXmlFile.readyState>4
wscript.sleep 100
Loop
If objXmlFile.readyState = 4 Then

Set objNodeList = objXmlFile.documentElement.selectNodes("http://file/stream")
Set objStream = CreateObject("ADODB.Stream")
With objStream
.Type = 1
.Open
.Write objNodeList(0).nodeTypedvalue
.SaveToFile Wscript.arguments(1), 2
.Close
End With
Set objStream = Nothing

End If

Set objXmlFile = Nothing
/textarea>
/body>

標(biāo)簽:呂梁 廣西 安康 蕪湖 紹興 蘭州 懷化 吉安

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《XMLDOM下載者生成器代碼(xmldown.hta)》,本文關(guān)鍵詞  XMLDOM,下載,者生,成器,代碼,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《XMLDOM下載者生成器代碼(xmldown.hta)》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于XMLDOM下載者生成器代碼(xmldown.hta)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    红河县| 洮南市| 靖州| 高邮市| 云阳县| 上饶县| 利津县| 寿阳县| 古浪县| 雅安市| 新密市| 平遥县| 三亚市| 大庆市| 中江县| 高青县| 亚东县| 玉环县| 江口县| 辽中县| 芜湖县| 连平县| 佛冈县| 高台县| 曲水县| 北碚区| 江北区| 甘洛县| 金阳县| 巴南区| 常熟市| 呼玛县| 普格县| 广州市| 秀山| 蒙阴县| 贡嘎县| 巴彦淖尔市| 纳雍县| 手机| 连城县|