Saves this BarcodeReadOptions to an XML file.
public void Save(string fileName)
Public Overloads Sub Save( _ByVal fileName As String _)
public:void Save(String^ fileName)
fileName
Name of the XML file to create
The load/save methods are provided as helper methods for the user. The BarcodeEngine, BarcodeReader and BarcodeWriter do not use these methods internally.
To load the data previously saved into an XML file, use BarcodeReadOptions.Load(string fileName).
To save and load data to an XML stream, use BarcodeReadOptions.Save(Stream stream) and BarcodeReadOptions.Load(Stream stream).
To save the default read options used by BarcodeReader, use BarcodeReader.SaveOptions
This example creates Linear 1D barcode read options class, saves it to the disk and then loads it back.
using Leadtools;using Leadtools.Codecs;using Leadtools.Forms;using Leadtools.Barcode;using Leadtools.ImageProcessing;public void BarcodeReadOptions_LoadSaveExample(){string xmlFileName = Path.Combine(LEAD_VARS.ImagesDir, "MyOptions.xml");// Create the optionsOneDBarcodeReadOptions options1 = new OneDBarcodeReadOptions();// Show its valuesShowOptions("Default 1", options1);// Change some of the valuesoptions1.SearchDirection = BarcodeSearchDirection.HorizontalAndVertical;options1.ReturnCheckDigit = BarcodeReturnCheckDigit.Default;options1.EnableErrorCheck = true;ShowOptions("New Options 1", options1);// Save it to diskoptions1.Save(xmlFileName);// Create new optionsOneDBarcodeReadOptions options2 = new OneDBarcodeReadOptions();// Show its valuesShowOptions("Default 2", options2);// Load the previously saved optionsoptions2.Load(xmlFileName);// Show its values, should be the same as "New Options 1"ShowOptions("Loaded 2", options2);}private static void ShowOptions(string message, OneDBarcodeReadOptions options){// We will only show some of the options in this exampleConsole.WriteLine(message);Console.WriteLine(" SearchDirection: {0}", options.SearchDirection);Console.WriteLine(" ReturnCheckDigit: {0}", options.ReturnCheckDigit);Console.WriteLine(" EnableErrorCheck: {0}", options.EnableErrorCheck);Console.WriteLine("----------------");}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.FormsImports Leadtools.BarcodeImports Leadtools.ImageProcessingPublic Sub BarcodeReadOptions_LoadSaveExample()Dim xmlFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "MyOptions.xml")' Create the optionsDim options1 As New OneDBarcodeReadOptions()' Show its valuesShowOptions("Default 1", options1)' Change some of the valuesoptions1.SearchDirection = BarcodeSearchDirection.HorizontalAndVerticaloptions1.ReturnCheckDigit = BarcodeReturnCheckDigit.Defaultoptions1.EnableErrorCheck = TrueShowOptions("New Options 1", options1)' Save it to diskoptions1.Save(xmlFileName)' Create new optionsDim options2 As New OneDBarcodeReadOptions()' Show its valuesShowOptions("Default 2", options2)' Load the previously saved optionsoptions2.Load(xmlFileName)' Show its values, should be the same as "New Options 1"ShowOptions("Loaded 2", options2)End SubPrivate Shared Sub ShowOptions(ByVal message As String, ByVal options As OneDBarcodeReadOptions)' We will only show some of the options in this exampleConsole.WriteLine(message)Console.WriteLine(" SearchDirection: {0}", options.SearchDirection)Console.WriteLine(" ReturnCheckDigit: {0}", options.ReturnCheckDigit)Console.WriteLine(" EnableErrorCheck: {0}", options.EnableErrorCheck)Console.WriteLine("----------------")End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
|
Products |
Support |
Feedback: Save(String) Method - Leadtools.Barcode |
Introduction |
Help Version 19.0.2017.6.21
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.