←选择平台

保存(string)方法

总结
保存此BarcodeReadOptions到XML文件。
语法
c#
VB
c++
公共无效保存(字符串文件名
公共过载保存(_按值传递文件名作为字符串_
公共无效保存(字符串^文件名

参数

文件名
要创建的XML文件的名称

讲话

加载/保存方法作为辅助方法提供给用户。的BarcodeEngineBarcodeReader而且BarcodeWriter不要在内部使用这些方法。

要将以前保存到XML文件中的数据加载到BarcodeReadOptions。负载(string文件名)

若要将数据保存并加载到XML流,请使用BarcodeReadOptions。保存(流流)而且BarcodeReadOptions。负载(流流)

保存所使用的默认读选项BarcodeReader,使用BarcodeReader。其

例子

这个示例创建线性1D条形码读取选项类,将其保存到磁盘,然后将其加载回来。

c#
VB
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.Barcode;使用Leadtools.ImageProcessing;公共无效BarcodeReadOptions_LoadSaveExample ()字符串xmlFileName = Path.Combine(LEAD_VARS.ImagesDir,“MyOptions.xml”);//创建选项OneDBarcodeReadOptions option1 =OneDBarcodeReadOptions ();//显示其值ShowOptions (“默认1”, options1);//改变一些值options1。搜索Direction = BarcodeSearchDirection.HorizontalAndVertical;options1。ReturnCheckDigit = BarcodeReturnCheckDigit.Default;options1。EnableErrorCheck =真正的ShowOptions (“新方案1”, options1);//保存到磁盘options1.Save (xmlFileName);//创建新选项OneDBarcodeReadOptions options2 =OneDBarcodeReadOptions ();//显示其值ShowOptions (“默认2”, options2);//加载之前保存的选项options2.Load (xmlFileName);//显示它的值,应该和"New Options 1"一样ShowOptions (“加载2”, options2);私人静态无效ShowOptions (字符串信息,OneDBarcodeReadOptions选项)//在这个例子中,我们只显示一些选项Console.WriteLine(消息);控制台。WriteLine (" SearchDirection: {0}", options.SearchDirection);控制台。WriteLine (" ReturnCheckDigit: {0}", options.ReturnCheckDigit);控制台。WriteLine (" EnableErrorCheck: {0}", options.EnableErrorCheck);控制台。WriteLine ("----------------");静态LEAD_VARS公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”
进口Leadtools进口Leadtools。编解码器进口Leadtools。条形码进口Leadtools。ImageProcessing公共BarcodeReadOptions_LoadSaveExample ()昏暗的xmlFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“MyOptions.xml”创建选项昏暗的options1作为OneDBarcodeReadOptions ()展示它的价值ShowOptions (“默认1”options1)改变一些价值观options1。搜索Direction = BarcodeSearchDirection.HorizontalAndVerticaloptions1。ReturnCheckDigit = BarcodeReturnCheckDigit。默认的options1。EnableErrorCheck =真正的ShowOptions (“新方案1”options1)将其保存到磁盘options1.Save (xmlFileName)创建新选项昏暗的options2作为OneDBarcodeReadOptions ()展示它的价值ShowOptions (“默认2”options2)'加载之前保存的选项options2.Load (xmlFileName)显示它的值,应该和New Options 1一样ShowOptions (“加载2”options2)结束私人共享ShowOptions (按值传递消息作为字符串按值传递选项作为OneDBarcodeReadOptions)在这个例子中,我们只会展示一些选项Console.WriteLine(消息)控制台。WriteLine (" SearchDirection: {0}"options.SearchDirection)控制台。WriteLine (" ReturnCheckDigit: {0}"options.ReturnCheckDigit)控制台。WriteLine (" EnableErrorCheck: {0}"options.EnableErrorCheck)控制台。WriteLine ("----------------"结束公共NotInheritableLEAD_VARS公共常量ImagesDir作为字符串“C: \ LEADTOOLS21 \ Resources \图片”结束
需求

目标平台

Leadtools。条形码作为sembly
188金宝搏的网址客服|支持|联系我们|知识产权公告
©1991 - 2021领德科技有限公司版权所有。