Xceed Binary Encoding Library Documentation
Encoding from file to memory (VB example)
Examples > Encoding from file to memory (VB example)

This sample encodes with the Base64 format from a file to memory

Visual Basic Copy Code

Dim xBinEncode As New XceedBinaryEncoding

Call xBinEncode.License( "your license key" ) 

Dim vaBytesRead As Variant
Dim vaEncoded As Variant 

Set xBinEncode.EncodingFormat = New XceedBase64EncodingFormat 

On Error Resume Next 

vaEncoded = xBinEncode.ReadFile("c:\temp\source.txt", 0, 0, bfpEncode, True, vaBytesRead) 

If Err.Number = 0 Then
  Call MsgBox("File encoded successfully!") 
Else
  Call MsgBox(Err.Description) 
End If 

On Error Goto 0

Set xBinEncode = Nothing