选择显示字体大小

用asp写个加密和解密的类(2)

     *************************begin
  
    for icount=1 to lenstring step 3
  
    tempbinary = mid(paramstring, icount, 3)
  
    response.write tempbinary
  
    tempbyteone= asc(mid(tempbinary, 1, 1)): tempsavebitsone=tempbyteone and 3
  
    tempbytetwo = asc(mid(tempbinary, 2, 1)): tempsavebitstwo=tempbytetwo and 15
  
    tempchar = asc(mid(tempbinary, 3, 1))
  
    tempbyteone = mid(sbase_64_characters, ((tempbyteone and 252) 4)+ 1, 1)
  
    tempbytetwo = mid(sbase_64_characters, (((tempbytetwo and 240)16) or (tempsavebitsone * 16) and &hff) + 1, 1)
  
    tempbytethree = mid(sbase_64_characters, (((tempchar and 192)64) or (tempsavebitstwo * 4) and &hff) + 1, 1)
  
    tempbytefour = mid(sbase_64_characters, (tempchar and 63) +1,1)
  
    tempstring = tempbyteone & tempbytetwo &tempbytethree& tempbytefour returnvalue=returnvalue &tempstringnext
  
    *************************end
  
    *************************begin处理最后剩余的几个字符
  
    if mod3string>0 then
  
    tempbinary = mid(paramstring, icount, mod3string)
  
    if mod3string=1 then
  
    tempstring = tempbinary & chr(64) & chr(64) &chr(64)用@号补足位数
  
    else tempstring = tempbinary & chr(64) &chr(64)用@号补足位数
  
    end if
  
    returnvalue=returnvalue & tempstring
  
    end if
  
    *************************end处理最后剩余的几个字符
  
    encode=returnvalue end if end function
  
    ********************************************
  
    end将ansi编码的字符串进行base64编码
  
    ********************************************
  
    ********************************************
  
    end将base64编码字符串转换成ansi编码的字符串
  
    ********************************************
  
    public function decode(paramstring)
  
    tempstring=
  
    returnvalue=
  
    lenstring=len(paramstring)
  
    if lenstring<1 then
  
    decode=returnvalue
  
    else
  
    mod4string=lenstring mod 4
  
    if mod4string >0 then 字符串长度应当是4的倍数
  
    decode=returnvalue
  
    else begin判断是不是@号
  
    if mid(paramstring, lenstring-1, 1) = @ then
  
    mod4string=2
  
    end if
  
    if mid(paramstring, lenstring-2, 1) = @ then
  
    mod4string=1
  
    end if
  
    end判断是不是@号
  
    if mod4string>0 then
  
    lenstring=lenstring-4
  
  
    ******************************begin
  
    for icount=1 to lenstring step 4
  
    tempstring = mid(paramstring, icount, 4)
  
    tempbyteone = instr(sbase_64_characters, mid(tempstring, 1, 1))-1
  
    tempbytetwo = instr(sbase_64_characters, mid(tempstring, 2, 1))-1
  
    tempbytethree = instr(sbase_64_characters, mid(tempstring, 3,1))- 1
  
    tempbytefour = instr(sbase_64_characters, mid(tempstring, 4, 1))-1
  
    tempbyteone = chr(((tempbytetwo and 48) 16) or (tempbyteone *4)and &hff) tempbytetwo = & chr(((tempbytethree and 60)4) or (tempbytetwo * 16) and &hff)
  
    tempbytethree = chr((((tempbytethree and 3) * 64) and &hff)or(tempbytefour and 63))
  
    tempstring=tempbyteone & tempbytetwo & tempbytethree
  
    returnvalue=returnvalue & tempstring
  
    next
  
    ******************************end
  
    处理最后剩余的几个字符
  
    if mod4string > 0 then
  
    tempstring=center(center(paramstring,4),mod4string)
  
    returnvalue = returnvalue & tempstring
  
    end if
  
    decode=returnvalue
  
    end if
  
    end if
  
    end function
  
    ********************************************
  
    end将base64编码字符串转换成ansi编码的字符串
  
    ********************************************
  
    作者:csdn pxjianke
  
  
  
    


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons