This sample demonstrates how to encode and decode single files using different kinds of encoding methods.
Project path: Samples\CSharp\Manager
Project file name: Manager.csproj
Properties: EndOfLineType, MaxLineLength, ContinueOnInvalidData, HeaderDataForkLength, HeaderResourceForkLength, HeaderFilename, EncodingFormat and IncludeHeaderFooter from the various Encoding format objects.
Methods: ProcessFile
The form contains two tabs. One for encoding and one for decoding.
Encoding: Specify the source path and file name of the file to encode, the destination file name and the encoding method to use and click the Encode button. When you type the source file name, if the destination file name is empty, it will automatically be set to the same filename as the source, but with the appropriate filename extension depending on the selected encoding method.
Decoding: Select one or more encoded files. These files are added to the list box. Select a destination path and a file name to decode to. The sample will decode all these files into a single destination file. All source files must therefore be encoded using the same encoding method. If the destination file name is left empty, the sample will automatically select a file name when decoding the first file from the list. Click the Decode button to begin the process.
From the menu bar, you can access the Option form. This form allows you to set the maximum line length, the end of line type and also lets you specify if the library should continue if it encounters invalid data when decoding.
All errors that occur when encoding or decoding are shown in a text box at the bottom of the main form.