<%
function Encode64System(tel)
sTel = ""
sstr = "AA"
tel=floor(tel)
arr = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/")
length=ubound(arr) + 1
while tel>= length
sTel=arr(tel mod length) & sTel
tel=floor(tel/length)
loop
sstr = sstr & arr(tel mod length) & sTel
Encode64System = sstr
end function
response.write Encode64System("12345678912")
%>

解决方案 »

  1.   

    function Encode64System(tel)
    On Error Resume Next
    sTel = ""
    sstr = "AA"
    tel2=fix(tel)
    arr = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/")
    length=ubound(arr) + 1
    do while tel2>= length
    sTel=arr(tel2 mod length) & sTel
    tel2=fix(tel2/length)
    loop
    sstr = sstr & arr(tel2 mod length) & sTel
    Encode64System = sstr
    end function
    response.write Encode64System("12345678912")
      

  2.   

    不好意思,我发现两段代码运行出来的结果不一样啊..不信可以运行一下13356332255,PHP代码输出的结果是AAMcGXTf,而asp代码运行出来的是AAMcGXT,高手可否再帮一下忙,我追加了20分,谢谢了。。
      

  3.   

    只要是mod溢出,参考下面地址的答案。http://cache.baidu.com/c?word=asp%2Cmod%2C%D2%E7%B3%F6&url=http%3A//topic%2Ecsdn%2Enet/t/20041202/11/3608370%2Ehtml&p=882a95418ad905e71ab0c7710e13cb&user=baidu