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

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

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

Listing B


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

用户评论

  • 用户名
  • 评论内容