Commit bf3534a9 刘韬

1

1 个父辈 4fe3a74d
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
......@@ -20,13 +20,13 @@
</logger>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="90000000" maxBufferPoolSize="90000000" maxBufferSize="90000000" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:01:00" sendTimeout="00:01:00">
<readerQuotas maxStringContentLength="90000000" maxArrayLength="90000000" maxBytesPerRead="90000000" />
<readerQuotas maxStringContentLength="90000000" maxArrayLength="90000000" maxBytesPerRead="90000000"/>
<security mode="None"/>
</binding>
</webHttpBinding>
......
......@@ -42,6 +42,7 @@ namespace ScanCodeServer
this.label3 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.btn_test = new System.Windows.Forms.Button();
this.参数ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
this.SuspendLayout();
......@@ -73,14 +74,15 @@ namespace ScanCodeServer
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.参数ToolStripMenuItem,
this.退出ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(101, 26);
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 70);
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
//
......@@ -154,6 +156,13 @@ namespace ScanCodeServer
this.btn_test.UseVisualStyleBackColor = true;
this.btn_test.Click += new System.EventHandler(this.btn_test_Click);
//
// 参数ToolStripMenuItem
//
this.参数ToolStripMenuItem.Name = "参数ToolStripMenuItem";
this.参数ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.参数ToolStripMenuItem.Text = "参数";
this.参数ToolStripMenuItem.Click += new System.EventHandler(this.参数ToolStripMenuItem_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -189,6 +198,7 @@ namespace ScanCodeServer
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btn_test;
private System.Windows.Forms.ToolStripMenuItem 参数ToolStripMenuItem;
}
}
......@@ -144,5 +144,11 @@ namespace ScanCodeServer
remoteDecodeParam.timeout = 3000;
webWork.Process(ho_Image, bitmap, remoteDecodeParam);
}
private void 参数ToolStripMenuItem_Click(object sender, EventArgs e)
{
AdvanceConfigForm advanceConfigForm = new AdvanceConfigForm();
advanceConfigForm.ShowDialog();
}
}
}
......@@ -328,6 +328,8 @@ namespace ScanCodeServer
ho_SymbolRegions.Dispose();
HOperatorSet.CreateBarCodeModel(new HTuple(), new HTuple(), out hv_BarCodeHandle);
if (Setting.HOperatorSet_element_size_min >= 0)
HOperatorSet.SetBarCodeParam(hv_BarCodeHandle, "element_size_min", (int)Setting.HOperatorSet_element_size_min);
HOperatorSet.FindBarCode(ho_GrayImage, out ho_SymbolRegions, hv_BarCodeHandle, "auto", out hv_DecodedDataStrings);
//HOperatorSet.AreaCenterXld(ho_SymbolRegions, out hv_Area, out hv_Row1, out hv_Column, out hv_PointOrder);
......
using System;
using ConfigHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
......@@ -21,6 +22,7 @@ namespace ScanCodeServer
return;
}
Config.LoadMyConfig(new Setting().GetType());
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
......
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ScanCodeServer.Properties {
using System;
namespace ScanCodeServer.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScanCodeServer.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
......@@ -55,14 +51,11 @@ namespace ScanCodeServer.Properties
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}
......
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ScanCodeServer.Properties {
namespace ScanCodeServer.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}
......
......@@ -8,10 +8,11 @@
<OutputType>WinExe</OutputType>
<RootNamespace>ScanCodeServer</RootNamespace>
<AssemblyName>ScanCodeServer</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
......@@ -77,6 +78,7 @@
<Compile Include="Monitor.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setting.cs" />
<Compile Include="WebServer.cs" />
<Compile Include="WebWork.cs" />
<EmbeddedResource Include="Form1.resx">
......@@ -90,6 +92,7 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.manifest" />
<None Include="packages.config" />
......
using ConfigHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ScanCodeServer
{
class Setting
{
[MyConfigComment("element_size_min -1不启用")]
public static MyConfig<int> HOperatorSet_element_size_min = -1;
}
}
......@@ -87,12 +87,13 @@ namespace ScanCodeServer
{
foreach (CodeInfo c in cc)
{
if (string.IsNullOrEmpty(c.CodeType))
c.CodeType = codeType;
c.CodeStr = RemoveInvalidXMLChars(c.CodeStr);
//c.CodeStr = "<![CDATA[" + c.CodeStr+"]]";
lock (code)
{
if (!code.Contains(c.CodeStr))
//if (!code.Contains(c.CodeStr))
{
Common.log.Info("识别到:" + c.CodeType + ", " + c.CodeStr);
code.Add(c.CodeStr);
......@@ -121,8 +122,11 @@ namespace ScanCodeServer
{
XmlSerializer xff = new XmlSerializer(typeof(List<CodeInfo>));
xff.Serialize(respStream, res.CodeInfos);
var b64= Convert.ToBase64String(respStream.ToArray(),Base64FormattingOptions.None);
//Common.log.Info("b64:" + b64);
//Common.log.Info("txt:" + Convert.FromBase64String(b64));
Monitor.Test();
return Convert.ToBase64String(respStream.ToArray());
return b64;
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!