The first portion of code demonstrates encoding, the second demonstrates decoding.
Visual Basic - Encoding |
Copy Code |
' This sample encodes with the Base64 format from one file to another
Dim xBinEncode As New XceedBinaryEncoding
Call xBinEncode.License( "your license key" )
Dim vaBytesRead As Variant
Set xBinEncode.EncodingFormat = New XceedBase64EncodingFormat
On Error Resume Next
Call xBinEncode.ProcessFile("c:\temp\source.txt", 0, 0, bfpEncode, _ True, "c:\temp\encoded.b64", False, 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 |
This sample decodes with the Base64 format from one file to another
Visual Basic - Decode |
Copy Code |
Dim xBinEncode As New XceedBinaryEncoding
Call xBinEncode.License( "your license key" )
Dim vaBytesRead As Variant
Set xBinEncode.EncodingFormat = New XceedBase64EncodingFormat
On Error Resume Next
Call xBinEncode.ProcessFile("c:\temp\encoded.b64", 0, 0, bfpDecode, _ True, "c:\temp\decoded.txt", False, vaBytesRead)
If Err.Number = 0 Then Call MsgBox("File decoded successfully!") Else Call MsgBox(Err.Description) End If
On Error Goto 0
xBinEncode = Nothing |