'文件读成16进制
'FileName:需要转变的文件
Function ReadBinary(FileName)
Const adTypeBinary = 1
Dim stream, xmldom, node
Set xmldom = CreateObject("Microsoft.XMLDOM")
Set node = xmldom.CreateElement("binary")
node.DataType = "bin.hex"
Set stream = CreateObject("ADODB.Stream")
stream.Type = adTypeBinary
stream.Open
stream.LoadFromFile FileName
node.NodeTypedValue = stream.Read
stream.Close
Set stream = Nothing
ReadBinary = node.Text
'MsgBox ReadBinary
Set node = Nothing
Set xmldom = Nothing
End Function
'test
hexText = ReadBinary ("文件的路径")
MsgBox hexText