程序员交流互动
大家共同的话题! 快去看看
<%
==================================================
函数名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
%>