Base64文件编码

2015-12-07 0 650
Base64文件编码
Function ReadBinary(FileName)
	Const adTypeBinary = 1
	Dim stream, xmldom, node
	Set xmldom = CreateObject("Microsoft.XMLDOM")
	Set node = xmldom.CreateElement("binary")
	node.DataType = "bin.base64"
	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
	Set node = Nothing
	Set xmldom = Nothing
End Function

Public Function WriteFile_Append(pathway,words)	
    Dim fileSystemObj,fileSpec,logFile,way
    Set fileSystemObj = CreateObject("Scripting.FileSystemObject")
    fileSpec = pathway 
    Set logFile = fileSystemObj.OpenTextFile(fileSpec, 8, true) 
    logFile.WriteLine (CStr(words))
    logFile.Close
    Set logFile = Nothing
End Function

hexVal = ReadBinary("c:\desk_2.png")
Call WriteFile_Append("c:\ttt.txt", hexVal)

遇见资源网 ASP/Basic Base64文件编码 http://www.ox520.com/13550.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务