''''''''''''''''''''''''''''''''
''
'내게로信用
'額度未結束
'投注
''編碼轉成中文.
''
''2006-12-22
''
''BW Wisdom
''
''QQ:214958266
''
''''''''''''''''''''''''''''''''
Public Class Code
Public Function AsciiToString(ByVal AsciiList() As Integer) As String
Dim i As Integer
Dim str As String
For i = 0 To AsciiList.Length - 1
str += ChrW(AsciiList(i))
Next
Return str
End Function
Public Function StringToAscii(ByVal [String] As String) As Integer()
Dim AsciiList([String].Length) As Integer
Dim i As Integer
For i = 0 To [String].Length - 1
AsciiList(i) = AscW(Mid([String], i + 1, 1))
Next
Return AsciiList
End Function
Public Function ChrWChr(ByVal AsciiCode As Integer) As String
Return ChrW(AsciiCode)
End Function
Public Function AscWint(ByVal [String] As String) As Integer
Return AscW([String])
End Function
Public Function Test() As String
Dim i(12) As Integer
'내게로信用
'額度未結束
'投注
i(0) = 45236
i(1) = 44172
i(2) = 47196
i(3) = 20449
i(4) = 29992
i(5) = 38989
i(6) = 24230
i(7) = 26410
i(8) = 32080
i(9) = 26463
i(9) = 25237
i(9) = 27880
Return AsciiToString(i) ''這個Test()函數將返回:"내게로信用額度未結注"這個字串
End Function
End Class
如果是在C#裡的話,用以下:
private string DeCode(string src)
{
// 參數值src為: 額度未結束投注
//則本次解碼成為:如額度未結束投注
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HttpUtility.HtmlDecode(src, sw);
sw.Close();
return sb.ToString();
}