XMLDOM 다운로드 자 생 성기 코드(xmldown.hta)
<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>
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
XMLDOM 과 ADODB.Stream 으로 base 64 인 코딩 디 코딩 실현 코드<html> <title> XMLDOM ADODB.Stream base64 </title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.