狠狠色丁香婷婷综合尤物/久久精品综合一区二区三区/中国有色金属学报/国产日韩欧美在线观看 - 国产一区二区三区四区五区tv

LOGO OA教程 ERP教程 模切知識(shí)交流 PMS教程 CRM教程 開(kāi)發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

ASP加密解密函數(shù)

admin
2010年5月8日 15:45 本文熱度 7351
<% [br] sbase_64_characters = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/" [br] sbase_64_characters = strunicode2ansi(sbase_64_characters) [br] [br] function strunicodelen(ascontents) [br] ''計(jì)算unicode字符串的ansi編碼的長(zhǎng)度 [br] ascontents1="a"&ascontents [br] len1=len(ascontents1) [br] k=0 [br] for i=1 to len1 [br] asc1=asc(mid(ascontents1,i,1)) [br] if asc1<0 then asc1=65536+asc1 [br] if asc1>255 then [br] k=k+2 [br] else [br] k=k+1 [br] end if [br] next [br] strunicodelen=k-1 [br] end function [br] [br] function strunicode2ansi(ascontents) [br] ''將unicode編碼的字符串,轉(zhuǎn)換成ansi編碼的字符串 [br] strunicode2ansi="" [br] len1=len(ascontents) [br] for i=1 to len1 [br] varchar=mid(ascontents,i,1) [br] varasc=asc(varchar) [br] if varasc<0 then varasc=varasc+65536 [br] if varasc>255 then [br] varhex=hex(varasc) [br] varlow=left(varhex,2) [br] varhigh=right(varhex,2) [br] strunicode2ansi=strunicode2ansi & chrb("&h" & varlow ) & chrb("&h" & varhigh ) [br] else [br] strunicode2ansi=strunicode2ansi & chrb(varasc) [br] end if [br] next [br] end function [br] [br] function stransi2unicode(ascontents) [br] ''將ansi編碼的字符串,轉(zhuǎn)換成unicode編碼的字符串 [br] stransi2unicode = "" [br] len1=lenb(ascontents) [br] if len1=0 then exit function [br] for i=1 to len1 [br] varchar=midb(ascontents,i,1) [br] varasc=ascb(varchar) [br] if varasc > 127 then [br] stransi2unicode = stransi2unicode & chr(ascw(midb(ascontents,i+1,1) & varchar)) [br] i=i+1 [br] else [br] stransi2unicode = stransi2unicode & chr(varasc) [br] end if [br] next [br] end function [br] [br] function base64encode(ascontents) [br] ''將ansi編碼的字符串進(jìn)行base64編碼 [br] ''ascontents應(yīng)當(dāng)是ansi編碼的字符串(二進(jìn)制的字符串也可以) [br] dim lnposition [br] dim lsresult [br] dim char1 [br] dim char2 [br] dim char3 [br] dim char4 [br] dim byte1 [br] dim byte2 [br] dim byte3 [br] dim savebits1 [br] dim savebits2 [br] dim lsgroupbinary [br] dim lsgroup64 [br] dim m4,len1,len2 [br] [br] len1=lenb(ascontents) [br] if len1<1 then [br] base64encode="" [br] exit function [br] end if [br] [br] m3=len1 mod 3 [br] if m3 > 0 then ascontents = ascontents & string(3-m3, chrb(0)) [br] ''補(bǔ)足位數(shù)是為了便于計(jì)算 [br] [br] if m3 > 0 then [br] len1=len1+(3-m3) [br] len2=len1-3 [br] else [br] len2=len1 [br] end if [br] [br] lsresult = "" [br] [br] for lnposition = 1 to len2 step 3 [br] lsgroup64 = "" [br] lsgroupbinary = midb(ascontents, lnposition, 3) [br] [br] byte1 = ascb(midb(lsgroupbinary, 1, 1)): savebits1 = byte1 and 3 [br] byte2 = ascb(midb(lsgroupbinary, 2, 1)): savebits2 = byte2 and 15 [br] byte3 = ascb(midb(lsgroupbinary, 3, 1)) [br] [br] char1 = midb(sbase_64_characters, ((byte1 and 252) \ 4) + 1, 1) [br] char2 = midb(sbase_64_characters, (((byte2 and 240) \ 16) or (savebits1 * 16) and &hff) + 1, 1) [br] char3 = midb(sbase_64_characters, (((byte3 and 192) \ 64) or (savebits2 * 4) and &hff) + 1, 1) [br] char4 = midb(sbase_64_characters, (byte3 and 63) + 1, 1) [br] lsgroup64 = char1 & char2 & char3 & char4 [br] [br] lsresult = lsresult & lsgroup64 [br] next [br] [br] ''處理最后剩余的幾個(gè)字符 [br] if m3 > 0 then [br] lsgroup64 = "" [br] lsgroupbinary = midb(ascontents, len2+1, 3) [br] [br] byte1 = ascb(midb(lsgroupbinary, 1, 1)): savebits1 = byte1 and 3 [br] byte2 = ascb(midb(lsgroupbinary, 2, 1)): savebits2 = byte2 and 15 [br] byte3 = ascb(midb(lsgroupbinary, 3, 1)) [br] [br] char1 = midb(sbase_64_characters, ((byte1 and 252) \ 4) + 1, 1) [br] char2 = midb(sbase_64_characters, (((byte2 and 240) \ 16) or (savebits1 * 16) and &hff) + 1, 1) [br] char3 = midb(sbase_64_characters, (((byte3 and 192) \ 64) or (savebits2 * 4) and &hff) + 1, 1) [br] [br] if m3=1 then [br] lsgroup64 = char1 & char2 & chrb(61) & chrb(61) ''用=號(hào)補(bǔ)足位數(shù) [br] else [br] lsgroup64 = char1 & char2 & char3 & chrb(61) ''用=號(hào)補(bǔ)足位數(shù) [br] end if [br] [br] lsresult = lsresult & lsgroup64 [br] end if [br] [br] base64encode = lsresult [br] [br] end function [br] [br] [br] function base64decode(ascontents) [br] ''將base64編碼字符串轉(zhuǎn)換成ansi編碼的字符串 [br] ''ascontents應(yīng)當(dāng)也是ansi編碼的字符串(二進(jìn)制的字符串也可以) [br] dim lsresult [br] dim lnposition [br] dim lsgroup64, lsgroupbinary [br] dim char1, char2, char3, char4 [br] dim byte1, byte2, byte3 [br] dim m4,len1,len2 [br] [br] len1= lenb(ascontents) [br] m4 = len1 mod 4 [br] [br] if len1 < 1 or m4 > 0 then [br] ''字符串長(zhǎng)度應(yīng)當(dāng)是4的倍數(shù) [br] base64decode = "" [br] exit function [br] end if [br] [br] ''判斷最后一位是不是 = 號(hào) [br] ''判斷倒數(shù)第二位是不是 = 號(hào) [br] ''這里m4表示最后剩余的需要單獨(dú)處理的字符個(gè)數(shù) [br] if midb(ascontents, len1, 1) = chrb(61) then m4=3 [br] if midb(ascontents, len1-1, 1) = chrb(61) then m4=2 [br] [br] if m4 = 0 then [br] len2=len1 [br] else [br] len2=len1-4 [br] end if [br] [br] for lnposition = 1 to len2 step 4 [br] lsgroupbinary = "" [br] lsgroup64 = midb(ascontents, lnposition, 4) [br] char1 = instrb(sbase_64_characters, midb(lsgroup64, 1, 1)) - 1 [br] char2 = instrb(sbase_64_characters, midb(lsgroup64, 2, 1)) - 1 [br] char3 = instrb(sbase_64_characters, midb(lsgroup64, 3, 1)) - 1 [br] char4 = instrb(sbase_64_characters, midb(lsgroup64, 4, 1)) - 1 [br] byte1 = chrb(((char2 and 48) \ 16) or (char1 * 4) and &hff) [br] byte2 = lsgroupbinary & chrb(((char3 and 60) \ 4) or (char2 * 16) and &hff) [br] byte3 = chrb((((char3 and 3) * 64) and &hff) or (char4 and 63)) [br] lsgroupbinary = byte1 & byte2 & byte3 [br] [br] lsresult = lsresult & lsgroupbinary [br] next [br] [br] ''處理最后剩余的幾個(gè)字符 [br] if m4 > 0 then [br] lsgroupbinary = "" [br] lsgroup64 = midb(ascontents, len2+1, m4) & chrb(65) ''chr(65)=a,轉(zhuǎn)換成值為0 [br] if m4=2 then ''補(bǔ)足4位,是為了便于計(jì)算 [br] lsgroup64 = lsgroup64 & chrb(65) [br] end if [br] char1 = instrb(sbase_64_characters, midb(lsgroup64, 1, 1)) - 1 [br] char2 = instrb(sbase_64_characters, midb(lsgroup64, 2, 1)) - 1 [br] char3 = instrb(sbase_64_characters, midb(lsgroup64, 3, 1)) - 1 [br] char4 = instrb(sbase_64_characters, midb(lsgroup64, 4, 1)) - 1 [br] byte1 = chrb(((char2 and 48) \ 16) or (char1 * 4) and &hff) [br] byte2 = lsgroupbinary & chrb(((char3 and 60) \ 4) or (char2 * 16) and &hff) [br] byte3 = chrb((((char3 and 3) * 64) and &hff) or (char4 and 63)) [br] [br] if m4=2 then [br] lsgroupbinary = byte1 [br] elseif m4=3 then [br] lsgroupbinary = byte1 & byte2 [br] end if [br] [br] lsresult = lsresult & lsgroupbinary [br] end if [br] [br] base64decode = lsresult [br] [br] end function %>

該文章在 2010/5/8 15:45:47 編輯過(guò)
關(guān)鍵字查詢(xún)
相關(guān)文章
正在查詢(xún)...
點(diǎn)晴ERP是一款針對(duì)中小制造業(yè)的專(zhuān)業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國(guó)內(nèi)大量中小企業(yè)的青睞。
點(diǎn)晴PMS碼頭管理系統(tǒng)主要針對(duì)港口碼頭集裝箱與散貨日常運(yùn)作、調(diào)度、堆場(chǎng)、車(chē)隊(duì)、財(cái)務(wù)費(fèi)用、相關(guān)報(bào)表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點(diǎn),圍繞調(diào)度、堆場(chǎng)作業(yè)而開(kāi)發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類(lèi)企業(yè)的高效ERP管理信息系統(tǒng)。
點(diǎn)晴WMS倉(cāng)儲(chǔ)管理系統(tǒng)提供了貨物產(chǎn)品管理,銷(xiāo)售管理,采購(gòu)管理,倉(cāng)儲(chǔ)管理,倉(cāng)庫(kù)管理,保質(zhì)期管理,貨位管理,庫(kù)位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號(hào)管理軟件。
點(diǎn)晴免費(fèi)OA是一款軟件和通用服務(wù)都免費(fèi),不限功能、不限時(shí)間、不限用戶(hù)的免費(fèi)OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved