vb.net中byte数组转成字符串的处理

                            Private Function ByteArrayToString(ByVal ByteArray As System.Array) As String 
'Dim s As String = System.Text.Encoding.Default.GetString(ByteArray) 
Dim strOut As String = "" 
For i As Integer = 0 To ByteArray.Length - 1 
If Not CType(ByteArray(i), Byte).ToString = 0 Then 
strOut &= System.Text.Encoding.Default.GetString(ByteArray, i, 1) 
End If 
Next 
Return strOut 
End Function 


Private Function ByteArrayToString(ByVal ByteArray As Byte()) As String 
Return System.Text.Encoding.Unicode.GetString(ByteArray) 
End Function 
                                

查看回复