Xceed Binary Encoding Library Documentation
Examples / Encoding and decoding entirely in memory (VB.NET example)
In This Topic
    Encoding and decoding entirely in memory (VB.NET example)
    In This Topic

    This sample encodes and decodes data in memory with the Base64 encoding format

    VB.NET Copy Code

    Dim encoder As New XceedBinaryEncodingLib.XceedBinaryEncodingClass() 

    encoder.License( "your license key" )      

    Try
      encoder.EncodingFormat = New XceedBinaryEncodingLib.XceedBase64EncodingFormatClass() 

      Dim source As Object = "This is the data to encode"

      ' Encode the data
      Dim encodedData As Object = encoder.Encode( source, true ) 

      ' Decoded the data
      Dim decodedData As Object = encoder.Decode( encodedData, true )

      MessageBox.Show( System.Text.Encoding.Unicode.GetString( CType( decodedData, Byte() ) ) ) 

    Catch except As System.Runtime.InteropServices.COMException
      MessageBox.Show( except.ToString() )
    End Try