Convert.ToBase64CharArray() and Convert.FromBase64CharArray methods : Data Type Convert « Data Type « VB.Net Tutorial






Imports System

Class Sample
   Public Shared Sub Main()
      Dim byteArray1(255) As Byte
      Dim byteArray2(255) As Byte
      Dim charArray(351) As Char
      Dim charArrayLength As Integer

      Dim x As Integer
      For x = 0 To byteArray1.Length - 1
         byteArray1(x) = CByte(x)
         Console.Write("{0:X2} ", byteArray1(x))
      Next x


      charArrayLength = Convert.ToBase64CharArray( _
                                byteArray1, 0, byteArray1.Length, _
                                charArray, 0, _
                                Base64FormattingOptions.InsertLineBreaks)
      Console.Write(charArrayLength)
      Console.WriteLine(New [String](charArray))

      byteArray2 = Convert.FromBase64CharArray(charArray, 0, charArrayLength)

   End Sub


End Class








2.45.Data Type Convert
2.45.1.CLng: convert integer to long
2.45.2.CByte: convert to byte
2.45.3.CSng: convert to Single
2.45.4.CDbl: convert to double
2.45.5.CDec: convert to decimal
2.45.6.Call Int64TryParse(String, NumberStyles, IFormatProvider, Int32)
2.45.7.Convert a string into a 64-bit signed integer value using the Int64.Parse(String) method
2.45.8.Convert.ToBase64CharArray() and Convert.FromBase64CharArray methods
2.45.9.Converts the bit patterns of UInt32 values to Byte arrays with the GetBytes method.
2.45.10.Convert.ToString( non-numeric types, IFormatProvider ).
2.45.11.Create a hexadecimal value out of range of the UInt64 type and Convert it back to a number.