本文整理汇总了VB.NET中System.Text.ASCIIEncoding.GetChars方法的典型用法代码示例。如果您正苦于以下问题:VB.NET ASCIIEncoding.GetChars方法的具体用法?VB.NET ASCIIEncoding.GetChars怎么用?VB.NET ASCIIEncoding.GetChars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.ASCIIEncoding
的用法示例。
在下文中一共展示了ASCIIEncoding.GetChars方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: ASCIIEncodingExample
' 导入命名空间
Imports System.Text
Class ASCIIEncodingExample
Public Shared Sub Main()
Dim chars() As Char
Dim bytes() As Byte = { _
65, 83, 67, 73, 73, 32, 69, _
110, 99, 111, 100, 105, 110, 103, _
32, 69, 120, 97, 109, 112, 108, 101}
Dim ascii As New ASCIIEncoding()
Dim charCount As Integer = ascii.GetCharCount(bytes, 6, 8)
chars = New Char(charCount - 1) {}
Dim charsDecodedCount As Integer = ascii.GetChars(bytes, 6, 8, chars, 0)
Console.WriteLine("{0} characters used to decode bytes.", charsDecodedCount)
Console.Write("Decoded chars: ")
Dim c As Char
For Each c In chars
Console.Write("[{0}]", c)
Next c
Console.WriteLine()
End Sub
End Class