28,409
社区成员




Public Function HexToBytes(ByVal str)
Dim node
With CreateObject("MSXML2.DOMDocument")
Set node = .createElement("temp")
node.dataType = "bin.hex"
node.text = str
HexToBytes = node.nodeTypedValue
End With
End Function
Public Function HexFromBytes(data)
Dim node
With CreateObject("MSXML2.DOMDocument")
Set node = .createElement("temp")
node.dataType = "bin.hex"
node.nodeTypedValue = data
HexFromBytes = node.text
End With
End Function
Public Function FileGetBinary(ByVal path)
With CreateObject("ADODB.Stream")
.Type = 1
.Open
.LoadFromFile path
FileGetBinary = .Read(-1)
.Close
End With
End Function
WScript.Echo HexFromBytes(FileGetBinary("test.txt"))