VB.NET,将文本String转换成Ascii编码……

Private Function toAscii(ByVal sIn As String) As String toAscii = Nothing On Error Resume Next Dim i As Integer Dim btmp() As Byte btmp = System.Text.Encoding.Default.GetBytes(sIn) For i = LBound(btmp) To UBound(btmp) toAscii = toAscii & "%" & Microsoft.VisualBasic.Right("00" & Hex(btmp(i)), 2) Next End Function

你可能感兴趣的:(VB.NET,将文本String转换成Ascii编码……)