Xceed Binary Encoding Library Documentation
Encoding and decoding from file to memory (VB.NET example)
Examples > Encoding and decoding from file to memory (VB.NET example)

This sample encodes with the Base64 format from a file to memory and decodes the encoded data from memory to a file.

VB.NET Copy Code

Dim encoder As New XceedBinaryEncodingLib.XceedBinaryEncodingClass() 

encoder.License( "your license key" )      

Try
  encoder.EncodingFormat = New XceedBinaryEncodingLib.XceedBase64EncodingFormatClass()        

  Dim bytesRead As object = Nothing 

  ' Read the data from the file and encode it to memory
  Dim encodedData As Object = encoder.ReadFile( "c:\test\file.txt", _
               0,0,XceedBinaryEncodingLib.EXBFileProcessing.bfpEncode ,true, bytesRead ) 

  ' Decode the encoded data located in memory to file
  encoder.WriteFile( encodedData, XceedBinaryEncodingLib.EXBFileProcessing.bfpDecode, _
                     true, "c:\test\decoded.txt", false ) 

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