SVN r1157
SVN-Revision: r1157
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.36602.28
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExecPythonPDF", "ExecPythonPDF\ExecPythonPDF.csproj", "{CFB86248-5DA9-4F84-B2BB-6044B62C1DDC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDFApi", "PDFApi\PDFApi.csproj", "{DD0C73CE-E2C0-4FFF-9A0F-3E40FCE1D46A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CFB86248-5DA9-4F84-B2BB-6044B62C1DDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CFB86248-5DA9-4F84-B2BB-6044B62C1DDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CFB86248-5DA9-4F84-B2BB-6044B62C1DDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CFB86248-5DA9-4F84-B2BB-6044B62C1DDC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DD0C73CE-E2C0-4FFF-9A0F-3E40FCE1D46A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DD0C73CE-E2C0-4FFF-9A0F-3E40FCE1D46A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DD0C73CE-E2C0-4FFF-9A0F-3E40FCE1D46A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DD0C73CE-E2C0-4FFF-9A0F-3E40FCE1D46A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E5D2507D-ABF1-4FF1-9E13-EBC243F32ACF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,177 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{CFB86248-5DA9-4F84-B2BB-6044B62C1DDC}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>ExecPythonPDF</RootNamespace>
|
||||
<AssemblyName>ExecPythonPDF</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="itext.barcodes, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.barcodes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.bouncy-castle-connector, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.bouncy-castle-connector.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.commons, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.commons.9.5.0\lib\net461\itext.commons.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.font_asian, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.font-asian.9.5.0\lib\net461\itext.font_asian.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.forms, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.forms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.io, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.io.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.kernel, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.kernel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.layout, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.layout.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.pdfa, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.pdfa.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.pdfua, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.pdfua.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.sign, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.sign.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.styledxmlparser, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.styledxmlparser.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itext.svg, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.9.5.0\lib\net461\itext.svg.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.5.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.5.0.0\lib\net461\Microsoft.Extensions.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Options, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Options.5.0.0\lib\net461\Microsoft.Extensions.Options.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Primitives.5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\A办公\lserp_cs_6.0\引用DLL\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Security.AccessControl, Version=6.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.AccessControl.6.0.1\lib\net461\System.Security.AccessControl.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Xml, Version=6.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Xml.6.0.2\lib\net461\System.Security.Cryptography.Xml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PythonConsole.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\AdobeFontMetrics\MustRead.html" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("ExecPythonPDF")]
|
||||
[assembly: Assemb
|
||||
@@ -0,0 +1,39 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ExecPythonPDF.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
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() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回此类使用的缓存的 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static glo
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,2 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <a
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,591 @@
|
||||
using iText.Kernel.Pdf;
|
||||
using iText.Kernel.Pdf.Canvas.Parser;
|
||||
using iText.Kernel.Pdf.Canvas.Parser.Data;
|
||||
using iText.Kernel.Pdf.Canvas.Parser.Listener;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace ExecPythonPDF
|
||||
{
|
||||
public class BankRecord
|
||||
{
|
||||
public string BankName { get; set; } = "";
|
||||
public string RefId { get; set; } = "";
|
||||
public string Amount { get; set; } = "";
|
||||
public string Date { get; set; } = "";
|
||||
public string PayeeAccount { get; set; } = "";
|
||||
public string PayeeName { get; set; } = "";
|
||||
public string PayeeBank { get; set; } = "";
|
||||
public string Remark { get; set; } = "";
|
||||
}
|
||||
|
||||
public static class PDFConvert
|
||||
{
|
||||
// ==== 静态构造函数:强制加载亚洲字体包,防止 IIS 懒加载导致 UniGB-UTF16-H 报错 ====
|
||||
static PDFConvert()
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Reflection.Assembly.Load("itext.font_asian");
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 忽略异常,防止主流程中断
|
||||
}
|
||||
}
|
||||
|
||||
public static JObject ExecutePdfExtraction(string fileUrl, string fileName)
|
||||
{
|
||||
JObject rtnJobject = new JObject();
|
||||
rtnJobject.Add("success", "false");
|
||||
rtnJobject.Add("code", "0");
|
||||
rtnJobject.Add("msg", "");
|
||||
rtnJobject.Add("data", new JArray());
|
||||
try
|
||||
{
|
||||
if (!Path.GetExtension(fileName).Equals(".pdf", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
throw new Exception("不是pdf文件");
|
||||
}
|
||||
|
||||
byte[] fileData;
|
||||
if (fileUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
using (WebClient webClient = new WebClient())
|
||||
{
|
||||
fileData = webClient.DownloadData(fileUrl);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fileData = File.ReadAllBytes(fileUrl);
|
||||
}
|
||||
|
||||
using (MemoryStream pdfStream = new MemoryStream(fileData))
|
||||
{
|
||||
string content = ConvertPdfToText(pdfStream);
|
||||
string bankName = BankExtractorFactory.IdentifyBank(fileName);
|
||||
if (string.IsNullOrEmpty(bankName))
|
||||
{
|
||||
throw new Exception("未知银行");
|
||||
}
|
||||
|
||||
List<BankRecord> records = BankExtractorFactory.GetExtractor(bankName).Extract(content);
|
||||
JArray dataArray = rtnJobject["data"] as JArray;
|
||||
foreach (BankRecord record in records)
|
||||
{
|
||||
dataArray.Add(JObject.FromObject(record));
|
||||
}
|
||||
rtnJobject["success"] = "true";
|
||||
rtnJobject["code"] = "1";
|
||||
rtnJobject["msg"] = "操作成功";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
rtnJobject["success"] = "false";
|
||||
rtnJobject["code"] = "0";
|
||||
rtnJobject["msg"] = ex.Message;
|
||||
}
|
||||
return rtnJobject;
|
||||
}
|
||||
|
||||
public static string ConvertPdfToText(Stream pdfStream)
|
||||
{
|
||||
StringBuilder textContent = new StringBuilder();
|
||||
try
|
||||
{
|
||||
using (PdfReader reader = new PdfReader(pdfStream))
|
||||
using (PdfDocument pdfDoc = new PdfDocument(reader))
|
||||
{
|
||||
for (int i = 1; i <= pdfDoc.GetNumberOfPages(); i++)
|
||||
{
|
||||
PdfPage page = pdfDoc.GetPage(i);
|
||||
CustomLayoutStrategy strategy = new CustomLayoutStrategy(3.0f);
|
||||
new PdfCanvasProcessor(strategy).ProcessPageContent(page);
|
||||
string pageText = strategy.GetResultantText();
|
||||
if (!string.IsNullOrWhiteSpace(pageText))
|
||||
{
|
||||
textContent.AppendLine($"--- 第{i}页 ---");
|
||||
textContent.AppendLine(pageText);
|
||||
}
|
||||
}
|
||||
}
|
||||
return textContent.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"PDF解析失败: {ex.Message}", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义布局策略:模拟 Python pdfplumber 的 y_tolerance 逻辑
|
||||
/// </summary>
|
||||
public class CustomLayoutStrategy : IEventListener
|
||||
{
|
||||
private readonly List<TextChunk> _chunks = new List<TextChunk>();
|
||||
private readonly float _yTolerance;
|
||||
|
||||
public CustomLayoutStrategy(float yTolerance = 3.0f)
|
||||
{
|
||||
_yTolerance = yTolerance;
|
||||
}
|
||||
|
||||
public void EventOccurred(IEventData data, EventType type)
|
||||
{
|
||||
if (type == EventType.RENDER_TEXT)
|
||||
{
|
||||
var renderInfo = (TextRenderInfo)data;
|
||||
var text = renderInfo.GetText();
|
||||
if (string.IsNullOrWhiteSpace(text)) return;
|
||||
|
||||
var segment = renderInfo.GetBaseline();
|
||||
var start = segment.GetStartPoint();
|
||||
|
||||
_chunks.Add(new TextChunk
|
||||
{
|
||||
Text = text,
|
||||
X = start.Get(0),
|
||||
Y = start.Get(1)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public ICollection<EventType> GetSupportedEvents()
|
||||
{
|
||||
return new HashSet<EventType> { EventType.RENDER_TEXT };
|
||||
}
|
||||
|
||||
public string GetResultantText()
|
||||
{
|
||||
if (_chunks.Count == 0) return "";
|
||||
|
||||
var sortedByY = _chunks.OrderByDescending(c => c.Y).ToList();
|
||||
var lines = new List<List<TextChunk>>();
|
||||
var currentLine = new List<TextChunk>();
|
||||
|
||||
if (sortedByY.Count > 0)
|
||||
{
|
||||
currentLine.Add(sortedByY[0]);
|
||||
float currentLineY = sortedByY[0].Y;
|
||||
|
||||
for (int i = 1; i < sortedByY.Count; i++)
|
||||
{
|
||||
var chunk = sortedByY[i];
|
||||
if (Math.Abs(chunk.Y - currentLineY) <= _yTolerance)
|
||||
{
|
||||
currentLine.Add(chunk);
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.Add(currentLine);
|
||||
currentLine = new List<TextChunk> { chunk };
|
||||
currentLineY = chunk.Y;
|
||||
}
|
||||
}
|
||||
lines.Add(currentLine);
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (var line in lines)
|
||||
{
|
||||
var sortedLine = line.OrderBy(c => c.X).ToList();
|
||||
sb.AppendLine(SmartJoin(sortedLine));
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private string SmartJoin(List<TextChunk> chunks)
|
||||
{
|
||||
if (chunks.Count == 0) return "";
|
||||
StringBuilder lineSb = new StringBuilder();
|
||||
lineSb.Append(chunks[0].Text);
|
||||
|
||||
for (int i = 1; i < chunks.Count; i++)
|
||||
{
|
||||
var prev = chunks[i - 1];
|
||||
var curr = chunks[i];
|
||||
if (curr.X - (prev.X + GetWidthEstimate(prev.Text)) > 5)
|
||||
{
|
||||
lineSb.Append(" ");
|
||||
}
|
||||
lineSb.Append(curr.Text);
|
||||
}
|
||||
return lineSb.ToString();
|
||||
}
|
||||
|
||||
private float GetWidthEstimate(string text)
|
||||
{
|
||||
return text.Length * 4.0f;
|
||||
}
|
||||
|
||||
private class TextChunk
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public float X { get; set; }
|
||||
public float Y { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
// --- 基类 ---
|
||||
public abstract class BankExtractor
|
||||
{
|
||||
public string BankName { get; }
|
||||
|
||||
protected BankExtractor(string bankName)
|
||||
{
|
||||
BankName = bankName;
|
||||
}
|
||||
|
||||
public abstract List<BankRecord> Extract(string content);
|
||||
|
||||
protected string ExtractSingleValue(string content, string pattern)
|
||||
{
|
||||
var match = Regex.Match(content, pattern);
|
||||
return match.Success ? match.Groups[1].Value.Trim() : "";
|
||||
}
|
||||
}
|
||||
|
||||
// --- 1. 中国银行 ---
|
||||
public class BOCExtractor : BankExtractor
|
||||
{
|
||||
public BOCExtractor() : base("中国银行") { }
|
||||
public override List<BankRecord> Extract(string content)
|
||||
{
|
||||
var records = new List<BankRecord>();
|
||||
var pages = content.Split(new[] { "--- 第" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
foreach (var rawPage in pages)
|
||||
{
|
||||
string pageContent = rawPage;
|
||||
if (string.IsNullOrWhiteSpace(pageContent)) continue;
|
||||
|
||||
string refId = ExtractSingleValue(pageContent, @"交易流水号[::][^\S\r\n]*([^\s]+)");
|
||||
if (string.IsNullOrEmpty(refId))
|
||||
{
|
||||
refId = ExtractSingleValue(pageContent, @"回单编号[::][^\S\r\n]*([^\s]+)");
|
||||
}
|
||||
if (string.IsNullOrEmpty(refId)) continue;
|
||||
|
||||
var record = new BankRecord
|
||||
{
|
||||
BankName = BankName,
|
||||
RefId = refId,
|
||||
Date = ExtractSingleValue(pageContent, @"日期[::][^\S\r\n]*(\d{4}年\d{1,2}月\d{1,2}日)"),
|
||||
};
|
||||
|
||||
string amountStr = ExtractSingleValue(pageContent, @"金额[::][^\S\r\n]*CNY([0-9,.]+)");
|
||||
record.Amount = amountStr.Replace(",", "");
|
||||
|
||||
record.PayeeAccount = ExtractSingleValue(pageContent, @"收款人账号[::][^\S\r\n]*([a-zA-Z0-9]+)");
|
||||
record.PayeeName = ExtractSingleValue(pageContent, @"收款人名称[::][^\S\r\n]*([^\r\n]+)");
|
||||
record.PayeeBank = ExtractSingleValue(pageContent, @"收款人开户行[::][^\S\r\n]*([^\r\n]+)");
|
||||
|
||||
string yongtu = ExtractSingleValue(pageContent, @"用途[::][^\S\r\n]*([^\r\n]+)");
|
||||
string beizhu = ExtractSingleValue(pageContent, @"备注[::][^\S\r\n]*([^\r\n]+)");
|
||||
string fuyan = ExtractSingleValue(pageContent, @"附言[::][^\S\r\n]*([^\r\n]+)");
|
||||
|
||||
var remarkList = new List<string>();
|
||||
if (!string.IsNullOrEmpty(yongtu)) remarkList.Add(yongtu);
|
||||
if (!string.IsNullOrEmpty(beizhu)) remarkList.Add(beizhu);
|
||||
if (!string.IsNullOrEmpty(fuyan)) remarkList.Add(fuyan);
|
||||
|
||||
record.Remark = string.Join("-", remarkList.Distinct());
|
||||
records.Add(record);
|
||||
}
|
||||
return records;
|
||||
}
|
||||
}
|
||||
|
||||
// --- 2. 工商银行 ---
|
||||
public class ICBCExtractor : BankExtractor
|
||||
{
|
||||
public ICBCExtractor() : base("工商银行") { }
|
||||
public override List<BankRecord> Extract(string content)
|
||||
{
|
||||
var records = new List<BankRecord>();
|
||||
var pages = content.Split(new[] { "--- 第" }, StringSplitOptions.None);
|
||||
var extractedIds = new HashSet<string>();
|
||||
|
||||
foreach (var rawPage in pages)
|
||||
{
|
||||
string pageContent = rawPage;
|
||||
if (string.IsNullOrWhiteSpace(pageContent)) continue;
|
||||
if (!pageContent.StartsWith("页 ---")) pageContent = "--- 第" + pageContent;
|
||||
|
||||
var record = new BankRecord { BankName = BankName };
|
||||
|
||||
record.RefId = ExtractSingleValue(pageContent, @"回单编号[::]\s*([^\s]+)");
|
||||
string amountStr = ExtractSingleValue(pageContent, @"小写[::]\s*([0-9,.]+)");
|
||||
record.Amount = amountStr.Replace(",", "");
|
||||
record.Date = ExtractSingleValue(pageContent, @"日期[::]\s*(\d{4}-\d{2}-\d{2})");
|
||||
|
||||
record.PayeeAccount = ExtractSingleValue(pageContent, @"收款人账号[::]\s*([a-zA-Z0-9]+)");
|
||||
record.PayeeBank = ExtractSingleValue(pageContent, @"收款人开户行[::]\s*([^\s]+)");
|
||||
record.PayeeName = ExtractSingleValue(pageContent, @"收款人户名[::]\s*([^\s]+)");
|
||||
|
||||
string summary = ExtractSingleValue(pageContent, @"摘要[::]\s*([^\s]+)");
|
||||
string usage = ExtractSingleValue(pageContent, @"用途[::]\s*([^\s]+)");
|
||||
|
||||
if (summary.Contains("用途:") || summary.Contains("交易机构号:")) summary = "";
|
||||
if (usage.Contains("交易机构号:") || usage.Contains("凭证号码:")) usage = "";
|
||||
|
||||
record.Remark = !string.IsNullOrEmpty(summary) ? summary : usage;
|
||||
|
||||
if (!string.IsNullOrEmpty(record.RefId) && !extractedIds.Contains(record.RefId))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(record.Amount) || !string.IsNullOrEmpty(record.Date))
|
||||
{
|
||||
records.Add(record);
|
||||
extractedIds.Add(record.RefId);
|
||||
}
|
||||
}
|
||||
}
|
||||
return records;
|
||||
}
|
||||
}
|
||||
|
||||
// --- 3. 成都银行 ---
|
||||
public class ChengduBankExtractor : BankExtractor
|
||||
{
|
||||
public ChengduBankExtractor() : base("成都银行") { }
|
||||
public override List<BankRecord> Extract(string content)
|
||||
{
|
||||
var records = new List<BankRecord>();
|
||||
var pages = content.Split(new[] { "--- 第" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
foreach (var rawPage in pages)
|
||||
{
|
||||
string pageContent = rawPage;
|
||||
if (string.IsNullOrWhiteSpace(pageContent)) continue;
|
||||
|
||||
string refPattern = @"参考号[^\S\r\n]*([^\s]+)[^\S\r\n]+交易日期[^\S\r\n]*(\d{4}-\d{2}-\d{2})";
|
||||
var refMatches = Regex.Matches(pageContent, refPattern);
|
||||
|
||||
for (int i = 0; i < refMatches.Count; i++)
|
||||
{
|
||||
var match = refMatches[i];
|
||||
string refId = match.Groups[1].Value;
|
||||
string date = match.Groups[2].Value;
|
||||
|
||||
int currentStart = match.Index;
|
||||
int prevEnd = (i > 0) ? (refMatches[i - 1].Index + refMatches[i - 1].Length) : 0;
|
||||
int lengthBefore = currentStart - prevEnd;
|
||||
string beforeSearchArea = (lengthBefore > 0) ? pageContent.Substring(prevEnd, lengthBefore) : "";
|
||||
|
||||
int nextStart = (i < refMatches.Count - 1) ? refMatches[i + 1].Index : pageContent.Length;
|
||||
int afterStart = match.Index + match.Length;
|
||||
int lengthAfter = nextStart - afterStart;
|
||||
string afterSearchArea = (lengthAfter > 0) ? pageContent.Substring(afterStart, lengthAfter) : "";
|
||||
|
||||
var record = new BankRecord
|
||||
{
|
||||
BankName = BankName,
|
||||
RefId = refId,
|
||||
Date = date,
|
||||
Amount = ExtractAmount(beforeSearchArea),
|
||||
PayeeAccount = ExtractSingleValue(beforeSearchArea, @"收款方账户[^\S\r\n]*([a-zA-Z0-9]*)"),
|
||||
PayeeName = ExtractSingleValue(beforeSearchArea, @"收款方户名[^\S\r\n]*([^\r\n]*)").Trim(),
|
||||
Remark = ExtractSingleValue(afterSearchArea, @"摘要[^\S\r\n]*([^\r\n]*)").Trim()
|
||||
};
|
||||
|
||||
var bankMatches = Regex.Matches(beforeSearchArea, @"开户行[^\S\r\n]*((?!开户行|方|款|付|收)[^\s]*)");
|
||||
if (bankMatches.Count > 0)
|
||||
{
|
||||
record.PayeeBank = bankMatches[bankMatches.Count - 1].Groups[1].Value.Trim();
|
||||
}
|
||||
|
||||
records.Add(record);
|
||||
}
|
||||
}
|
||||
return records;
|
||||
}
|
||||
|
||||
private string ExtractAmount(string searchArea)
|
||||
{
|
||||
int pos = searchArea.LastIndexOf("交易金额");
|
||||
if (pos != -1)
|
||||
{
|
||||
string relevant = searchArea.Substring(0, pos);
|
||||
var lines = relevant.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
string numPattern = @"([\d,]+\.?\d*)\s*$";
|
||||
for (int j = lines.Length - 1; j >= 0; j--)
|
||||
{
|
||||
var m = Regex.Match(lines[j].Trim(), numPattern);
|
||||
if (m.Success) return m.Groups[1].Value.Replace(",", "");
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// --- 4. 民生银行 ---
|
||||
public class CMBCExtractor : BankExtractor
|
||||
{
|
||||
public CMBCExtractor() : base("民生银行") { }
|
||||
public override List<BankRecord> Extract(string content)
|
||||
{
|
||||
var records = new List<BankRecord>();
|
||||
var pages = content.Split(new[] { "--- 第" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
foreach (var rawPage in pages)
|
||||
{
|
||||
string pageContent = rawPage;
|
||||
if (string.IsNullOrWhiteSpace(pageContent)) continue;
|
||||
|
||||
var refMatch = Regex.Match(pageContent, @"交易流水号\s+([^\s]+)");
|
||||
if (!refMatch.Success) continue;
|
||||
|
||||
var record = new BankRecord
|
||||
{
|
||||
BankName = BankName,
|
||||
RefId = refMatch.Groups[1].Value,
|
||||
Date = ExtractSingleValue(pageContent, @"记账时间\s+(\d{4}-\d{2}-\d{2})")
|
||||
};
|
||||
|
||||
string amountStr = ExtractSingleValue(pageContent, @"金额 人民币[::]\s*([0-9,.]+)");
|
||||
record.Amount = amountStr.Replace(",", "");
|
||||
|
||||
record.PayeeName = GetRightColumnValue(pageContent, "全称");
|
||||
record.PayeeAccount = GetRightColumnValue(pageContent, "账号");
|
||||
record.PayeeBank = GetRightColumnValue(pageContent, "开户行");
|
||||
record.Remark = ExtractSingleValue(pageContent, @"(?:客户附言|附言)\s+([^\s]+)");
|
||||
|
||||
records.Add(record);
|
||||
}
|
||||
return records;
|
||||
}
|
||||
|
||||
private string GetRightColumnValue(string content, string keyword)
|
||||
{
|
||||
var matches = Regex.Matches(content, keyword + @"[^\S\r\n]+([^\s]+)");
|
||||
if (matches.Count >= 2)
|
||||
{
|
||||
return matches[1].Groups[1].Value.Trim();
|
||||
}
|
||||
else if (matches.Count == 1)
|
||||
{
|
||||
return matches[0].Groups[1].Value.Trim();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// --- 5. 浙商银行 ---
|
||||
public class CZBankExtractor : BankExtractor
|
||||
{
|
||||
public CZBankExtractor() : base("浙商银行") { }
|
||||
public override List<BankRecord> Extract(string content)
|
||||
{
|
||||
var records = new List<BankRecord>();
|
||||
var pages = content.Split(new[] { "--- 第" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
foreach (var rawPage in pages)
|
||||
{
|
||||
string pageContent = rawPage;
|
||||
if (string.IsNullOrWhiteSpace(pageContent)) continue;
|
||||
|
||||
var refMatch = Regex.Match(pageContent, @"交易流水号[::]\s*([^\s]+)");
|
||||
if (!refMatch.Success) continue;
|
||||
|
||||
string refId = refMatch.Groups[1].Value;
|
||||
|
||||
var record = new BankRecord
|
||||
{
|
||||
BankName = BankName,
|
||||
RefId = refId,
|
||||
Date = ExtractDate(pageContent),
|
||||
Amount = ExtractAmount(pageContent),
|
||||
PayeeName = GetRightColumnValue(pageContent, "户名"),
|
||||
PayeeAccount = GetRightColumnValue(pageContent, "账号"),
|
||||
};
|
||||
|
||||
record.PayeeBank = ExtractPayeeBank(pageContent);
|
||||
|
||||
string yongtu = CleanBorderArtifacts(ExtractSingleValue(pageContent, @"用途[::][^\S\r\n]*([^\s]*)"));
|
||||
string fuyan = CleanBorderArtifacts(ExtractSingleValue(pageContent, @"附言[::][^\S\r\n]*([^\s]*)"));
|
||||
string zhaiyao = CleanBorderArtifacts(ExtractSingleValue(pageContent, @"摘要[::][^\S\r\n]*([^\s]*)"));
|
||||
string beizhu = CleanBorderArtifacts(ExtractSingleValue(pageContent, @"备注[::][^\S\r\n]*([^\s]*)"));
|
||||
|
||||
var remarkList = new List<string>();
|
||||
if (!string.IsNullOrEmpty(yongtu)) remarkList.Add(yongtu);
|
||||
if (!string.IsNullOrEmpty(fuyan)) remarkList.Add(fuyan);
|
||||
if (!string.IsNullOrEmpty(zhaiyao)) remarkList.Add(zhaiyao);
|
||||
if (!string.IsNullOrEmpty(beizhu)) remarkList.Add(beizhu);
|
||||
|
||||
record.Remark = string.Join("-", remarkList.Distinct());
|
||||
|
||||
records.Add(record);
|
||||
}
|
||||
return records;
|
||||
}
|
||||
|
||||
private string CleanBorderArtifacts(string text)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text)) return "";
|
||||
if (text.Length == 1 && "本凭证作客户收付款通知人".Contains(text)) return "";
|
||||
return text;
|
||||
}
|
||||
|
||||
private string ExtractDate(string text)
|
||||
{
|
||||
var m = Regex.Match(text, @"(?:银行日期|交易时间)[::]\s*(\d{4}-\d{2}-\d{2})");
|
||||
return m.Success ? m.Groups[1].Value : "";
|
||||
}
|
||||
|
||||
private string ExtractAmount(string text)
|
||||
{
|
||||
var m = Regex.Match(text, @"金额\s+人民币[^\r\n¥]*¥([0-9,.\d]+)");
|
||||
if (!m.Success) m = Regex.Match(text, @"金额\s+人民币(?:[^¥]*?)¥([0-9,.\d]+)");
|
||||
return m.Success ? m.Groups[1].Value.Replace(",", "") : "";
|
||||
}
|
||||
|
||||
private string GetRightColumnValue(string content, string keyword)
|
||||
{
|
||||
var matches = Regex.Matches(content, keyword + @"[::]");
|
||||
if (matches.Count >= 2)
|
||||
{
|
||||
return GetValueAfterMatch(content, matches[1], null);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private string ExtractPayeeBank(string content)
|
||||
{
|
||||
var matches = Regex.Matches(content, @"开户银行[::]");
|
||||
if (matches.Count >= 2)
|
||||
{
|
||||
string bank1 = GetValueAfterMatch(content, matches[0], matches[1]);
|
||||
string bank2 = GetValueAfterMatch(content, matches[1], null);
|
||||
|
||||
if (string.IsNullOrEmpty(bank2)) return "";
|
||||
|
||||
if (content.Contains("(借)") || content.Contains("(借)"))
|
||||
{
|
||||
if (bank2.Contains("浙商银行") && !bank1.Contains("浙商银行")) return bank1;
|
||||
if (bank1.Contains("浙商银行") && !bank2.Contains("浙商银行")) return bank2;
|
||||
}
|
||||
|
||||
return bank2;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private string GetValueAfterMatch(string content, Match currentMatch, Match nextMatch)
|
||||
{
|
||||
int p = currentMatch.Index + currentMatch.Length;
|
||||
while (p < content.Length && (content[p] == ' ' || content[p] == '\t')) p++;
|
||||
|
||||
int endLimit = nextMatch != null ? nextMatch.Index : content.Length;
|
||||
|
||||
int endP = p;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
|
||||
<meta name="generator" content="Adobe GoLive 4">
|
||||
<title>Core 14 AFM Files - ReadMe</title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="white">
|
||||
<font color="white">or</font>
|
||||
<table border="0" cellpadding="0" cellspacing="2">
|
||||
<tr>
|
||||
<td width="40"></td>
|
||||
<td width="300">This file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any purpose and without charge, with or without modification, provided that all copyright notices are retained; that the AFM files are not distributed without this file; that all modifications to this file or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files. <font color="white">Col</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="itext" version="9.5.0" targetFramework="net48" />
|
||||
<package id="itext.commons" version="9.5.0" targetFramework="net48" />
|
||||
<package id="itext.font-asian" version="9.5.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection" version="5.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="5.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Logging" version="5.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="5.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Options" version="5.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Primitives" version="5.0.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="5.0.0" targetFramework="net48" />
|
||||
<package id="System.Memory" version="4.5.4" targetFramework="net48" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net48" />
|
||||
<package id="System.Security.AccessControl" version="6.0.1" targetFramework="net48" />
|
||||
<package id="System.Security.Cryptography.Xml" version="6.0.2" targetFramework="net48" />
|
||||
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net48" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />
|
||||
<package id="UglyToad.PdfPig.Core" version="1.7.0-custom-5" targetFramework="net48" />
|
||||
<package id="UglyToad.PdfPig.Fonts" version="1.7.0-custom-5" targetFramework="net48" />
|
||||
<package id="UglyToad.PdfPig.Tokenization" version="1.7.0-custom-5" targetFramework="net48" />
|
||||
<package id="UglyToad.PdfPig.Tokens" version="1.7.0-custom-5" targetFramework="net48" />
|
||||
</packages>
|
||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
using ExecPythonPDF;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace PDFApi.Controllers
|
||||
{
|
||||
public class PdfController : ApiController
|
||||
{
|
||||
[HttpPost]
|
||||
[Route("Api/ProcessPDF")] // 自定义路由
|
||||
public IHttpActionResult ProcessPDF([FromBody] PDFRequest request)
|
||||
{
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<%@ Application Codebehind="Global.asax.cs" Inherits="PDFApi.WebApiApplication" Language="C#" %>
|
||||
Binary file not shown.
@@ -0,0 +1,155 @@
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{DD0C73CE-E2C0-4FFF-9A0F-3E40FCE1D46A}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>PDFApi</RootNamespace>
|
||||
<AssemblyName>PDFApi</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<Use64BitIISExpress />
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="itext.font_asian, Version=9.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\itext.font-asian.9.5.0\lib\net461\itext.font_asian.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Entity" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Net.Http.Formatting">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
|
||||
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App_Start\WebApiConfig.cs" />
|
||||
<Compile Include="Controllers\PdfController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
<None Include="Web.Release.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ExecPythonPDF\ExecPythonPDF.csproj">
|
||||
<Project>{cfb86248-5da9-4f84-b2bb-6044b62c1ddc}</Project>
|
||||
<Name>ExecPythonPDF</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>True</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>61392</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:61392/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过下列特性集
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("PDFApi")]
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<DeleteExistingFiles>False</DeleteExistingFiles>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<PublishProvider>FileSystem</PublishProvider>
|
||||
<PublishUrl>bin\app.publish\</PublishUrl>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- 有关使用 web.config 转换的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
在下例中,“SetAttributes”转换将更改
|
||||
“connectionString”的值,以仅在“Match”定位器
|
||||
找到值为“MyDB”的特性“name”时使用“ReleaseSQLServer”。
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<!--
|
||||
|
||||
在下例中,“Replace”转换将替换
|
||||
web.config 文件的整个 <customErrors> 节。
|
||||
请注意,由于
|
||||
在 <system.web> 节点下仅有一个 customErrors 节,因此不需要使用“xdt:Locator”特性。
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- 有关使用 web.config 转换的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
在下例中,“SetAttributes”转换将更改
|
||||
“connectionString”的值,以仅在“Match”定位器
|
||||
找到值为“MyDB”的特性“name”时使用“ReleaseSQLServer”。
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||
<!--
|
||||
|
||||
在下例中,“Replace”转换将替换
|
||||
web.config 文件的整个 <customErrors> 节。
|
||||
请注意,由于
|
||||
在 <system.web> 节点下仅有一个 customErrors 节,因此不需要使用“xdt:Locator”特性。
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
有关如何配置 ASP.NET 应用程序的详细信息,请访问
|
||||
https://go.microsoft.com/fwlink/?LinkId=301879
|
||||
-->
|
||||
<configuration>
|
||||
<appSettings>
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.8" />
|
||||
<httpRuntime targetFramework="4.8" />
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.codedom>
|
||||
<compilers>
|
||||
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
|
||||
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
|
||||
</compilers>
|
||||
</system.codedom>
|
||||
</configuration>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="itext.font-asian" version="9.5.0" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="5.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client.zh-Hans" version="5.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core.zh-Hans" version="5.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost.zh-Hans" version="5.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user