如何将VB.NET字符串转换成字节数组

开发者在线 Builder.com.cn 更新时间:2007-06-20作者:builder.com.cn 来源:

本文关键词: VB.NET vb.net

Listing A


Dim strText As String = "This is an original string"
Dim encText As New System.Text.UTF8Encoding()
Dim btText() As Byte
btText = encText.GetBytes(strText)
MessageBox.Show("The total number of encoded bytes is: " & btText.Length.ToString())

用户评论

  • 用户名
  • 评论内容