• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    asp base64 utf-8为了兼容asp.net的base64
    复制代码 代码如下:

    %@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    %Session.CodePage=65001%>
    !--#include file="base64.asp"-->
    %
    Function AspUrlDecode(strValue)
    Dim varAry, varElement, objStream, lngLoop, Flag
    strValue = Replace(strValue, "+", " ")
    varAry = Split(strValue, "%")
    Flag = varAry(0) = ""
    Set objStream = Server.CreateObject("ADODB.Stream")
    With objStream
    .Type = 2
    .Mode = 3
    .Open
    For Each varElement In varAry
    If varElement > Empty Then
    If Len(varElement) >= 2 And Flag Then
    .WriteText ChrB(CInt("H" Left(varElement, 2)))
    For lngLoop = 3 To Len(varElement)
    .WriteText ChrB(Asc(Mid(varElement, lngLoop, 1)))
    Next
    Else
    For lngLoop = 1 To Len(varElement)
    .WriteText ChrB(Asc(Mid(varElement, lngLoop, 1)))
    Next
    Flag = True
    End If
    End If
    Next
    .WriteText Chr(0)
    .Position = 0
    AspUrlDecode = Replace(ConvUnicode(.ReadText), Chr(0), "", 1, -1, 0)
    On Error Resume Next
    .Close
    Set objStream = Nothing
    End With
    End Function



    Function ConvUnicode(ByVal strData)
    Dim rs, stm, bytAry, intLen
    If Len(strData "") > 0 Then
    strData = MidB(strData, 1)
    intLen = LenB(strData)
    Set rs = Server.CreateObject("ADODB.Recordset")
    Set stm = Server.CreateObject("ADODB.Stream")
    With rs
    .Fields.Append "X", 205, intLen
    .Open
    .AddNew
    rs(0).AppendChunk strData ChrB(0)
    .Update
    bytAry = rs(0).GetChunk(intLen)
    End With
    With stm
    .Type = 1
    .Open
    .Write bytAry
    .Position = 0
    .Type = 2
    .Charset = "utf-8"
    ConvUnicode = .ReadText
    End With
    End If
    On Error Resume Next
    stm.Close
    Set stm = Nothing
    rs.Close
    Set rs = Nothing
    End Function


    %>
    !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    html xmlns="http://www.w3.org/1999/xhtml">
    head>
    meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    /head>
    body>
    %


    'base64编码后,比起.net多了77u/
    Response.Write("base64编码后:"base64Encode("阿会楠")"br />")

    'base64解码后
    Response.Write("base64解码后:"base64uncode("6Zi/5Lya5qWg")"br />")

    %>
    /body>
    /html>

    上一篇:asp 横排显示数据
    下一篇:两个非常规ASP木马(可躲过扫描)
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    asp base64 utf-8为了兼容asp.net的base64 asp,base64,utf-8,为了,兼容,