熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

asp國標轉大五碼

2022-06-13   來源: .NET編程 
程序員交流互動 大家共同的話題! 快去看看
<%
==================================================
函數名gbbig
作 用國標碼轉大五碼
參 數Text 字符串
作 者netyum(楊嵩)
Q Q:
時 間
==================================================
Function gbbig(Text)
Dim AdosMaxicbhl
If IsNull(Text) Or Text = Then Exit Function

Set Ados=ServerCreateObject(AdodbStream)
AdosMode =
AdosType =
AdosOpen
AdosLoadFromFile(ServerMapPath(gbbigtable))

Text = ServerUrlEnCode(Text)
b =
Max = Len(Text)
For i= To Max
c = Mid(Texti)
If c = % Then
h = eval(&h+Mid(Texti+))
If h < Then
b = b & chr(h)
i = i+
Else
If isvalidhex(mid(Texti)) Then
If isvalidhex(mid(Texti+)) Then
l = eval(&h+Mid(Texti+))
AdosPosition = (h)*+(l)*
b = b & bytesBSTR(AdosRead())
i = i+
Else
b = b &
i = i+
End If
End If
End If
Else
If c = + Then
b = b &
Else
b = b & c
End If
End If
Next
Set Ados = Nothing
gbbig = b
End Function

Function isvalidhex(str)
isvalidhex=true
str=ucase(str)
If Len(str) <> Then isvalidhex = false : Exit Function
if Left(str) <> % Then isvalidhex = false : Exit Function
c = Mid(str)
If Not (((c>=) And (c<=)) Or ((c>=A) And (c<=Z))) Then isvalidhex = false : Exit Function
c = Mid(str)
If Not (((c>=) And (c<=)) Or ((c>=A) And (c<=Z))) Then isvalidhex = false : Exit Function
End Function

Function bytesBSTR(vIn)
Dim strReturn
Dim iThisCharCodeNextCharCode
strReturn =
For i = To LenB(vIn)
ThisCharCode = AscB(MidB(vIni))
If ThisCharCode < &H Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIni+))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H + CInt(NextCharCode))
i = i +
End If
Next
bytesBSTR = strReturn
End Function
%>

From:http://tw.wingwit.com/Article/program/net/201311/13717.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.