Commit 53de98e3 authored by tr's avatar tr

1、数据库开发工具(功能:创建数据库表和生成模型类)

parent 6e4a4d9e
...@@ -5,3 +5,5 @@ ...@@ -5,3 +5,5 @@
/FunnyPick/.vs/FunnyPick/v16/Server/sqlite3 /FunnyPick/.vs/FunnyPick/v16/Server/sqlite3
/FunnyPick/.vs/FunnyPick/v16/.suo /FunnyPick/.vs/FunnyPick/v16/.suo
/FunnyPick/.vs/FunnyPick/DesignTimeBuild/.dtbcache /FunnyPick/.vs/FunnyPick/DesignTimeBuild/.dtbcache
obj
bin
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
\ No newline at end of file
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="AppSetting" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="AppSetting">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string" />
<xs:element name="Value" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//AppSetting" />
<xs:field xpath="Name" />
</xs:unique>
</xs:element>
</xs:schema>
<AppSetting>
<Name>LinkString</Name>
<Value>Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=Temp;Data Source=.</Value>
</AppSetting>
<AppSetting>
<Name>ExportPath</Name>
<Value />
</AppSetting>
</NewDataSet>
\ No newline at end of file
...@@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 ...@@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 16
VisualStudioVersion = 16.0.29411.108 VisualStudioVersion = 16.0.29411.108
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FunnyPick", "FunnyPick\FunnyPick.csproj", "{74FE44AE-D01E-41FC-9DD1-65A5DA2CFC7B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunnyPick", "FunnyPick\FunnyPick.csproj", "{74FE44AE-D01E-41FC-9DD1-65A5DA2CFC7B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools", "..\Tools\Tools.csproj", "{C5AB3CE9-C46A-467D-96E4-D80DD3BBB239}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
...@@ -15,6 +17,10 @@ Global ...@@ -15,6 +17,10 @@ Global
{74FE44AE-D01E-41FC-9DD1-65A5DA2CFC7B}.Debug|Any CPU.Build.0 = Debug|Any CPU {74FE44AE-D01E-41FC-9DD1-65A5DA2CFC7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74FE44AE-D01E-41FC-9DD1-65A5DA2CFC7B}.Release|Any CPU.ActiveCfg = Release|Any CPU {74FE44AE-D01E-41FC-9DD1-65A5DA2CFC7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74FE44AE-D01E-41FC-9DD1-65A5DA2CFC7B}.Release|Any CPU.Build.0 = Release|Any CPU {74FE44AE-D01E-41FC-9DD1-65A5DA2CFC7B}.Release|Any CPU.Build.0 = Release|Any CPU
{C5AB3CE9-C46A-467D-96E4-D80DD3BBB239}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5AB3CE9-C46A-467D-96E4-D80DD3BBB239}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5AB3CE9-C46A-467D-96E4-D80DD3BBB239}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5AB3CE9-C46A-467D-96E4-D80DD3BBB239}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
6. Trademarks.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "{}" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
\ No newline at end of file
namespace Tools.MyCommon
{
partial class wBasic
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(wBasic));
this.SuspendLayout();
//
// wBasic
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(278, 174);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "wBasic";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "基础窗口";
this.ResumeLayout(false);
}
#endregion
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Tools.MyCommon
{
/// <summary>
/// 基础窗口:包括Icon和FormStartPosition.CenterScreen
/// </summary>
public partial class wBasic : Form
{
public wBasic()
{
InitializeComponent();
}
}
}
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAMDAAAAEAIACoJQAAFgAAACgAAAAwAAAAYAAAAAEAIAAAAAAAACQAAAAAAAAAAAAAAAAAAAAA
AADoogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iR
x/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////
////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W////
/////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+ii
AP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+ii
AP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iR
x/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////
////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W////
/////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+ii
AP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+ii
AP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iR
x/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////
////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W////
/////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+ii
AP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+ii
AP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iR
x/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+iiAP/12Zn/////////
////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W////
/////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+iiAP/oogD/6KIA/+ii
AP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//oogD/6KIA/+ii
AP/oogD/6KIA/+iiAP/12Zn/////////////////8ujB/+rZmf/q2Zn/6tmZ/+rZmf/q2Zn/6tmZ/+rZ
mf/q2Zn/6tmZ/+rZmf/q2Zn/9u/W/////////////////8iRx/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o//stDP/7LQz/+y0M//stDP/7LQz/+y0M//34a3/////////////////9OzO/+7grf/u4K3/7uCt/+7g
rf/u4K3/7uCt/+7grf/u4K3/7uCt/+7grf/u4K3/+PLe/////////////////9On0v+2bbX/tm21/7Zt
tf+2bbX/tm21/7Zttf+2bbX/tm21/7Zttf+2bbX/tm21/7Zttf+2bbX/tm21/7Zttf+2bbX/tm21/7Zt
tf+2bbX/tm21/7Zttf//////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////T5f//0+X//9Pl
///T5f//0+X//9Pl///t9P//////////////////9Onz/+za7P/s2uz/7Nrs/+za7P/s2uz/7Nrs/+za
7P/s2uz/7Nrs/+za7P/s2uz/9/D3/////////////////+L4///O9P//zvT//870///O9P//zvT//870
///O9P//zvT//870///O9P//zvT//870///O9P//zvT//870///O9P//zvT//870///O9P//zvT//870
//8nf///J3///yd///8nf///J3///yd///+oy///////////////////yJHH/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/2rba/////////////////27e//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8nf///J3///yd///8nf///J3///yd///+oy///////////////////yJHH/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/2rba/////////////////27e
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8nf///J3///yd///8nf///J3///yd///+oy///////////
////////yJHH/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/2rba////
/////////////27e//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8nf///J3///yd///8nf///J3///yd/
//+oy///////////////////yJHH/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/2rba/////////////////27e//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8nf///J3///yd/
//8nf///J3///yd///+oy///////////////////yJHH/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/2rba/////////////////27e//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8nf///J3///yd///8nf///J3///yd///+oy///////////////////yJHH/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/2rba/////////////////27e//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8nf///J3///yd///8nf///J3///yd///+oy///////////////////yJHH/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/2rba/////////////////27e
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8nf///J3///yd///8nf///J3///yd///+oy///////////
////////yJHH/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/2rba////
/////////////27e//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8nf///J3///yd///8nf///J3///yd/
//+oy///////////////////yJHH/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/2rba/////////////////27e//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8nf///J3///yd/
//8nf///J3///yd///+oy///////////////////yJHH/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/2rba/////////////////27e//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8nf///J3///yd///8nf///J3///yd///+oy///////////////////yJHH/6RJo/+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/2rba/////////////////27e//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8nf///J3///yd///8nf///J3///yd///+oy///////////////////yJHH/6RJ
o/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo/+kSaP/2rba/////////////////27e
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J
//8Oyf//Dsn//w7J//8Oyf//Dsn//w7J//99sv//fbL//32y//99sv//fbL//32y///L4P//////////
////////3r3d/8iRx//Ikcf/yJHH/8iRx//Ikcf/yJHH/8iRx//Ikcf/yJHH/8iRx//Ikcf/6dPo////
/////////////6jr//9u3v//bt7//27e//9u3v//bt7//27e//9u3v//bt7//27e//9u3v//bt7//27e
//9u3v//bt7//27e//9u3v//bt7//27e//9u3v//bt7//27e////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
///////////////////attr/2rba/9q22v/attr/2rba/9q22v/w4fD/////////////////xsHi/6GZ
z/+hmc//oZnP/6GZz/+hmc//oZnP/6GZz/+hmc//oZnP/6GZz/+hmc//2dbr/////////////////8rI
+v+npPf/p6T3/6ek9/+npPf/p6T3/6ek9/+npPf/p6T3/6ek9/+npPf/p6T3/6ek9/+npPf/p6T3/6ek
9/+npPf/p6T3/6ek9/+npPf/p6T3/6ek9/+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//attr/////////
////////cma3/xUAiP8VAIj/FQCI/xUAiP8VAIj/FQCI/xUAiP8VAIj/FQCI/xUAiP8VAIj/oZnP////
/////////////3t29P8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc
7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJ
o//attr/////////////////cma3/xUAiP8VAIj/FQCI/xUAiP8VAIj/FQCI/xUAiP8VAIj/FQCI/xUA
iP8VAIj/oZnP/////////////////3t29P8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc
7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f+kSaP/pEmj/6RJ
o/+kSaP/pEmj/6RJo//attr/////////////////cma3/xUAiP8VAIj/FQCI/xUAiP8VAIj/FQCI/xUA
iP8VAIj/FQCI/xUAiP8VAIj/oZnP/////////////////3t29P8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc
7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc
7f+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//attr/////////////////cma3/xUAiP8VAIj/FQCI/xUA
iP8VAIj/FQCI/xUAiP8VAIj/FQCI/xUAiP8VAIj/oZnP/////////////////3t29P8kHO3/JBzt/yQc
7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc
7f8kHO3/JBzt/yQc7f+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//attr/////////////////cma3/xUA
iP8VAIj/FQCI/xUAiP8VAIj/FQCI/xUAiP8VAIj/FQCI/xUAiP8VAIj/oZnP/////////////////3t2
9P8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc
7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f+kSaP/pEmj/6RJo/+kSaP/pEmj/6RJo//attr/////////
////////cma3/xUAiP8VAIj/FQCI/xUAiP8VAIj/FQCI/xUAiP8VAIj/FQCI/xUAiP8VAIj/oZnP////
/////////////3t29P8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc
7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAA=
</value>
</data>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//----------------------------------------------
using System.Data;
using System.Data.SqlClient;
namespace Tools.MyData
{
/// <summary>
/// 数据库操作类
/// </summary>
public class SmpDB : IDisposable
{
#region IDisposable Support
private bool disposedValue = false; // 要检测冗余调用
protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
if (disposing)
{
// TODO: 释放托管状态(托管对象)。
}
// TODO: 释放未托管的资源(未托管的对象)并在以下内容中替代终结器。
// TODO: 将大型字段设置为 null。
disposedValue = true;
}
}
// TODO: 仅当以上 Dispose(bool disposing) 拥有用于释放未托管资源的代码时才替代终结器。
// ~SmpDB()
// {
// // 请勿更改此代码。将清理代码放入以上 Dispose(bool disposing) 中。
// Dispose(false);
// }
// 添加此代码以正确实现可处置模式。
void IDisposable.Dispose()
{
// 请勿更改此代码。将清理代码放入以上 Dispose(bool disposing) 中。
Dispose(true);
// TODO: 如果在以上内容中替代了终结器,则取消注释以下行。
// GC.SuppressFinalize(this);
}
#endregion
/// <summary>
/// 获取数据表
/// </summary>
/// <param name="strLink">数据库连接字串</param>
/// <param name="strSql">SQL语句</param>
/// <param name="strLink">数据库连接字串</param>
/// <returns></returns>
public DataTable GetDataTable(string strLink, string strSql, string strTableName)
{
DataTable dt = new DataTable(strTableName);
SqlConnection conn = null;
try
{
conn = new SqlConnection(strLink);
conn.Open();
var ada = new SqlDataAdapter(strSql, conn);
ada.FillSchema(dt, SchemaType.Mapped);//取出数据结构
ada.Fill(dt);//填充数据
}
catch (Exception ex)
{
if (conn.State == ConnectionState.Open)
conn.Close();
throw (new Exception("获取数据出错:\r\n" + ex.Message));
}
return dt;
}
/// <summary>
/// 获取数据集
/// </summary>
/// <param name="strLink">数据库连接字串</param>
/// <param name="strSql">SQL语句</param>
/// <param name="strLink">数据库连接字串</param>
/// <returns></returns>
public DataSet GetData(string strLink, string strSql, string strTableName)
{
DataSet dsData = new DataSet();
SqlConnection conn = null;
SqlDataAdapter ada = null;
try
{
conn = new SqlConnection(strLink);
conn.Open();
ada = new SqlDataAdapter(strSql, conn);
ada.FillSchema(dsData, SchemaType.Mapped, strTableName);//取出数据结构
ada.Fill(dsData, strTableName);//填充数据
}
catch (Exception ex)
{
if (conn.State == ConnectionState.Open)
conn.Close();
throw (new Exception("获取数据出错:\r\n" + ex.Message));
}
return dsData;
}
/// <summary>
/// 获取数据集
/// </summary>
/// <param name="strLink">数据库连接字串</param>
/// <param name="Tables">表的扩展集合</param>
/// <param name="Schema">是否获取结构信息</param>
/// <returns></returns>
public DataSet GetData(string strLink, List<TQuery> Tables, bool Schema)
{
DataSet ds = new DataSet();
SqlConnection conn = null;
SqlCommand cmd = null;
SqlDataAdapter ada = null;
try
{
conn = new SqlConnection(strLink);
conn.Open();
foreach (TQuery t in Tables)
{
cmd = new SqlCommand(t.QuerySQL, conn);
if (t.SlctParameters.Count > 0)
{
foreach (SqlParameter para in t.SlctParameters)
{
cmd.Parameters.Add(para);
}
}
ada = new SqlDataAdapter(cmd);
if (Schema)
{
ada.FillSchema(ds, SchemaType.Mapped, t.TableName);//取出数据结构
}
ada.Fill(ds, t.TableName);//填充数据
}
}
catch (Exception ex)
{
throw (new Exception("获取数据出错:\r\n" + ex.Message));
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
return ds;
}
/// <summary>
/// 保存数据表
/// <para>单表效率测试:100行0.75秒;500行3.7秒;5000行36秒左右</para>
/// </summary>
/// <param name="dt">待保存表</param>
/// <param name="strLink">数据库连接字串</param>
/// <returns></returns>
public bool SaveDataTable(string strLink, DataTable dt)
{
SqlConnection conn = null;
SqlTransaction tran = null;
//
string cmdText = $"Select * from {dt.TableName}";
try
{
conn = new SqlConnection(strLink);
conn.Open();
var dataAdapter = new SqlDataAdapter(cmdText, conn);
var commandBuilder = new SqlCommandBuilder(dataAdapter)
{
ConflictOption = ConflictOption.OverwriteChanges,
};
if (dt.PrimaryKey.Length > 0)//没有主键是不能自动生成删除和更新语句的
{
dataAdapter.DeleteCommand = commandBuilder.GetDeleteCommand();
dataAdapter.UpdateCommand = commandBuilder.GetUpdateCommand();
}
dataAdapter.InsertCommand = commandBuilder.GetInsertCommand();
tran = conn.BeginTransaction();//开始事务,并设置回滚点
if (dataAdapter.DeleteCommand != null)//删除和更新有可能为空
dataAdapter.DeleteCommand.Transaction = tran;
if (dataAdapter.UpdateCommand != null)
dataAdapter.UpdateCommand.Transaction = tran;
//
dataAdapter.InsertCommand.Transaction = tran;
dataAdapter.Update(dt);
tran.Commit();
}
catch (Exception ex)
{
if (tran != null)
tran.Rollback();
throw (new Exception("保存数据集出错:\r\n" + ex.Message));
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
return true;
}
/// <summary>
/// 保存数据集
/// <para>单表效率测试:100行0.75秒;500行3.7秒;5000行36秒左右</para>
/// </summary>
/// <param name="ds">待保存的数据集</param>
/// <param name="strLink">数据库连接字串</param>
/// <returns></returns>
public bool SaveData(string strLink, DataSet ds, string strTableName)
{
SqlConnection conn = null;
SqlDataAdapter dataAdapter = null;
SqlCommandBuilder commandBuilder = null;
SqlTransaction tran = null;
//
string cmdText = $"Select * from {strTableName}";
try
{
conn = new SqlConnection(strLink);
conn.Open();
dataAdapter = new SqlDataAdapter(cmdText, conn);
commandBuilder = new SqlCommandBuilder(dataAdapter)
{
ConflictOption = ConflictOption.OverwriteChanges
};
if (ds.Tables[strTableName].PrimaryKey.Length > 0)//没有主键是不能自动生成删除和更新语句的
{
dataAdapter.DeleteCommand = commandBuilder.GetDeleteCommand();
dataAdapter.UpdateCommand = commandBuilder.GetUpdateCommand();
}
dataAdapter.InsertCommand = commandBuilder.GetInsertCommand();
tran = conn.BeginTransaction();//开始事务,并设置回滚点
if (dataAdapter.DeleteCommand != null)//删除和更新有可能为空
dataAdapter.DeleteCommand.Transaction = tran;
if (dataAdapter.UpdateCommand != null)
dataAdapter.UpdateCommand.Transaction = tran;
//
dataAdapter.InsertCommand.Transaction = tran;
dataAdapter.Update(ds, strTableName);
tran.Commit();
}
catch (Exception ex)
{
if (tran != null)
tran.Rollback();
throw (new Exception("保存数据集出错:\r\n" + ex.Message));
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
return true;
}
/// <summary>
/// 保存数据集
/// <para>单表效率测试:100行0.76秒;500行3.7秒;5000行37秒左右</para>
/// </summary>
/// <param name="ds">数据集</param>
/// <param name="strLink">数据库连接字串</param>
/// <param name="Tables">表的扩展集合</param>
/// <returns></returns>
public bool SaveData(string strLink, DataSet ds, List<TQuery> Tables)
{
List<SqlDataAdapter> SqlDAList = new List<SqlDataAdapter>();
//
SqlConnection conn = null;
SqlDataAdapter dataAdapter = null;
SqlCommandBuilder commandBuilder = null;
SqlTransaction tran = null;
string cmdText = string.Empty;
try
{
conn = new SqlConnection(strLink);
conn.Open();
//生成命令
foreach (TQuery t in Tables)
{
cmdText = $"Select * from {t.TableName}";
dataAdapter = new SqlDataAdapter(cmdText, conn);
commandBuilder = new SqlCommandBuilder(dataAdapter)
{
ConflictOption = ConflictOption.OverwriteChanges
};
dataAdapter.DeleteCommand = commandBuilder.GetDeleteCommand();
dataAdapter.InsertCommand = commandBuilder.GetInsertCommand();
dataAdapter.UpdateCommand = commandBuilder.GetUpdateCommand();
SqlDAList.Add(dataAdapter);
}
//开启事务,统一设置事务回滚点
tran = conn.BeginTransaction();
foreach (var a in SqlDAList)
{
a.DeleteCommand.Transaction = tran;
a.UpdateCommand.Transaction = tran;
a.InsertCommand.Transaction = tran;
}
//更新数据
for (int i = 0; i < SqlDAList.Count; i++)
{
var tn = Tables[i].TableName;
SqlDAList[i].Update(ds, tn);
}
//提交事务
tran.Commit();
}
catch (Exception ex)
{
if (tran != null)
tran.Rollback();
throw (new Exception("保存数据集出错:\r\n" + ex.Message));
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
return true;
}
/// <summary>
/// 数据库连接测试
/// </summary>
/// <param name="strLink">数据库连接字串</param>
/// <returns></returns>
public bool ConnectionTest(string strLink)
{
SqlConnection conn = null;
try
{
conn = new SqlConnection(strLink);
conn.Open();
}
catch (Exception)
{
return false;
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
return true;
}
/// <summary>
/// 执行SQL语句:这里的多条语句采用同一事务处理,方便出错时回滚,保证数据统一
/// </summary>
/// <param name="strLink">数据库连接</param>
/// <param name="strExecSqlList">带执行的SQL列表</param>
/// <returns></returns>
public bool ExecNonSql(string strLink, List<string> strExecSqlList, CommandType cmdType = CommandType.Text)
{
SqlConnection conn = null;
SqlCommand cmd = null;
SqlTransaction tran = null;
try
{
conn = new SqlConnection(strLink);
conn.Open();
tran = conn.BeginTransaction();//开始事务
cmd = new SqlCommand();
cmd.Connection = conn;//绑定连接
cmd.Transaction = tran;//绑定事务
//批量处理命令
foreach (string cmdText in strExecSqlList)
{
cmd.CommandText = cmdText;
cmd.CommandType = cmdType;
int ret = cmd.ExecuteNonQuery();
}
//提交事务
tran.Commit();
}
catch (Exception ex)
{
if (tran != null)
tran.Rollback();
throw (new Exception("执行SQL出错:\r\n" + ex.Message));
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
return true;
}
/// <summary>
/// 是否存在
/// </summary>
/// <param name="strLink"></param>
/// <param name="strSql"></param>
/// <returns></returns>
public bool IsExist(string strLink, string strSql)
{
SqlConnection conn = null;
SqlCommand cmd = null;
object objCount = null;
try
{
conn = new SqlConnection(strLink);
conn.Open();
cmd = new SqlCommand(strSql, conn);
objCount = cmd.ExecuteScalar();
}
catch (Exception ex)
{
throw (new Exception("是否存在执行出错:\r\n" + ex.Message));
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
int iCount = -1;
if (!int.TryParse(objCount.ToString(), out iCount))
{
throw (new Exception("数据类型转换失败!"));
}
return iCount > 0;
}
#region async methods
/*
* 异步方法使用演示:
*
* 1.同步调用:
* ConnectionTestAsync(link).GetAwaiter().GetResult();
* 2.异步调用:
* public async void SomeMethod()
* {
* DataSet ds = await ConnectionTestAsync(link);
* }
* 注意:
* 1、同步调动需通过GetAwaiter().GetResult()等待结果
* 2、异步需使用async修饰,才能在方法内部使用await关键字。
* 使用async修饰的异步方法,必须返回void或Task<T>
*/
/// <summary>
/// 单表取数(异步)
/// </summary>
/// <param name="strLink"></param>
/// <param name="strSql"></param>
/// <param name="strTableName"></param>
/// <returns></returns>
public Task<DataTable> GetDataTableAsync(string strLink, string strSql, string strTableName)
{
return Task.Run(() => GetDataTable(strLink, strSql, strTableName));
}
/// <summary>
/// 单表取数(异步)
/// </summary>
/// <param name="strLink"></param>
/// <param name="strSql"></param>
/// <param name="strTableName"></param>
/// <returns></returns>
public Task<DataSet> GetDataAsync(string strLink, string strSql, string strTableName)
{
return Task.Run(() => GetData(strLink, strSql, strTableName));
}
/// <summary>
/// 多表取数(异步)
/// </summary>
/// <param name="strLink"></param>
/// <param name="Tables"></param>
/// <param name="Schema"></param>
/// <returns></returns>
public Task<DataSet> GetDataAsync(string strLink, List<TQuery> Tables, bool Schema)
{
return Task.Run(() => GetData(strLink, Tables, Schema));
}
/// <summary>
/// 单表保存(异步)
/// </summary>
/// <param name="ds"></param>
/// <param name="strLink"></param>
/// <param name="strTableName"></param>
/// <returns></returns>
public Task<bool> SaveDataTableAsync(string strLink, DataTable dt, string strTableName)
{
return Task.Run(() => SaveDataTable(strLink, dt));
}
/// <summary>
/// 单表保存(异步)
/// </summary>
/// <param name="ds"></param>
/// <param name="strLink"></param>
/// <param name="strTableName"></param>
/// <returns></returns>
public Task<bool> SaveDataAsync(string strLink, DataSet ds, string strTableName)
{
return Task.Run(() => SaveData(strLink, ds, strTableName));
}
/// <summary>
/// 多表保存(异步)
/// </summary>
/// <param name="ds"></param>
/// <param name="strLink"></param>
/// <param name="Tables"></param>
/// <returns></returns>
public Task<bool> SaveDataAsync(string strLink, DataSet ds, List<TQuery> Tables)
{
return Task.Run(() => SaveData(strLink, ds, Tables));
}
/// <summary>
/// 数据库连接测试(异步)
/// </summary>
/// <param name="strLink"></param>
/// <returns></returns>
public Task<bool> ConnectionTestAsync(string strLink)
{
return Task.Run(() => ConnectionTest(strLink));
}
/// <summary>
/// SQL批量执行(异步)
/// </summary>
/// <param name="strLink"></param>
/// <param name="strExecSqlList"></param>
/// <returns></returns>
public Task<bool> ExecNonSqlAsync(string strLink, List<string> strExecSqlList)
{
return Task.Run(() => ExecNonSql(strLink, strExecSqlList));
}
/// <summary>
/// 是否存在(异步)
/// </summary>
/// <param name="strLink"></param>
/// <param name="strSql"></param>
/// <returns></returns>
public Task<bool> ISExistAsync(string strLink, string strSql)
{
return Task.Run(() => IsExist(strLink, strSql));
}
#endregion
}
/// <summary>
/// 多表操作-自定义扩展类
/// </summary>
public class TQuery
{
/// <summary>
/// 构造器
/// </summary>
/// <param name="TableName">数据库表名</param>
public TQuery(string TableName)
{
this.TableName = TableName;
}
/// <summary>
/// 构造器
/// </summary>
/// <param name="Name">数据库表名</param>
/// <param name="QuerySQL">查询语句</param>
public TQuery(string TableName, string QuerySQL)
{
this.TableName = TableName;
this.QuerySQL = QuerySQL;
}
/// <summary>
/// 数据库表名
/// </summary>
public string TableName { get; set; }
/// <summary>
/// Select语句
/// </summary>
public string QuerySQL { get; set; }
/// <summary>
/// 选择语句参数
/// </summary>
public List<SqlParameter> SlctParameters = new List<SqlParameter>();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//
using System.Data;
using System.Xml.Linq;
using NPOI.SS.UserModel;
using System.IO;
using System.Drawing;
using NPOI.SS.Util;
using NPOI.HSSF.UserModel;
using NPOI.XSSF.UserModel;
namespace Tools.MyUtils
{
/// <summary>
/// NPOI导出Excel帮助类
/// <para>I只支持.xls类型,如果需要处理.xlsx文件,可以实现XSSF对应的版本</para>
/// </summary>
public class NPOIExcelHelper
{
#region 私有变量
/// <summary>
/// Excel文件对象
/// </summary>
IWorkbook _Workbook = null;
/// <summary>
/// 全局数据集
/// </summary>
DataSet _ds = null;
/// <summary>
/// 类型标识(xls/xlsx)
/// </summary>
bool IsXls = false;
#endregion
/// <summary>
/// 导出文件(绝对)路径
/// </summary>
public string ExportFileName { get; set; }
/// <summary>
/// 构造函数
/// </summary>
/// <param name="excelMouldName">模板名称</param>
/// <param name="xmlName">(数据源)xml配置文件</param>
/// <param name="keyID">单据主键</param>
public NPOIExcelHelper() { }
#region 统一导出接口
/// <summary>
/// 统一导出接口(自定义数据源)
/// </summary>
/// <param name="ctrl"></param>
/// <param name="xml"></param>
/// <param name="keyID"></param>
/// <param name="exportPath"></param>
/// <param name="m"></param>
public void Export(DataSet ds, string mouldFilePath, string exportFileName)
{
if (ds == null)
{
Utils.Tip("导出数据源不能为空!");
return;
}
if (!File.Exists(mouldFilePath))
{
Utils.Tip("模板文件不存在!");
return;
}
//赋值全局数据源
this._ds = ds;
//模板类型标识(xls/xlsx)
this.IsXls = new FileInfo(mouldFilePath).Extension.ToLower().Equals(".xls");
//模板导出路径
this.ExportFileName = exportFileName;
//获取模板的Workbook对象
this._Workbook = this.GetWorkbook(mouldFilePath);
//成功时,打开文件
if (this.ExportSingle())
{
Utils.Tip("Excel导出成功!");
//System.Diagnostics.Process.Start(this.ExportFileName);
}
}
#endregion
/// <summary>
/// 导出(单sheet页)
/// </summary>
/// <returns></returns>
private bool ExportSingle()
{
try
{
//填充sheet模板数据
var sheet = (ISheet)this._Workbook?.GetSheetAt(0);
this.FillSheet(sheet);
//保存Excel文件
this.SaveExcel(this.ExportFileName);
}
catch (Exception ex)
{
Utils.Tip($"导出失败:{ex.Message}");
return false;
}
finally
{
GC.Collect();
}
return true;
}
/// <summary>
/// 填充Sheet模板:多行合并渲染
/// </summary>
/// <param name="sheet"></param>
/// <param name="rowIndex"></param>
private void FillSheet(ISheet sheet)
{
/*模板导出规则:
* 1、每行只能是一种类型,要么全部是基本信息,要么全是明细(如果混合,则按第一个绑定信息类型界定此行类型)
* 基本信息绑定格式:[表名.字段名]
* 明细信息绑定格式:(表名.字段名)
* 合并信息绑定格式:{表名.字段名}
* 二维码绑定格式:<表名.字段名>
* 2、图片必须以Image或Picture结尾,区分大小写
*/
#region 填充模板数据
int currentRow = 0;
int EmptyCounts = 0; //空行命中次数
while (EmptyCounts < 20) //如果连续空行命中超过20,则认为是文档结尾
{
//取出列与绑定信息的关系
List<ExcelBindModel> bindList = new List<ExcelBindModel>();
for (int col = 0; col <= 50; col++) //只处理前50列
{
ICell cell = sheet?.GetRow(currentRow)?.GetCell(col);
if (cell == null)
continue;
//记录绑定信息
string bind = cell.StringCellValue;
bool IsBaseInfo = bind.StartsWith("[") && bind.EndsWith("]");
bool IsDetailInfo = bind.StartsWith("(") && bind.EndsWith(")");
bool IsMerge = bind.StartsWith("{") && bind.EndsWith("}");
bool IsQRCode = bind.StartsWith("<") && bind.EndsWith(">");
string[] strArray = bind.Trim(new char[] { '[', ']', '(', ')', '{', '}', '<', '>' }).Split('.'); //去除括号,并分割表名与列名
if ((IsBaseInfo || IsDetailInfo || IsMerge || IsQRCode) && strArray.Length == 2)
{
bindList.Add(new ExcelBindModel
{
TableName = strArray[0],
ColumnName = strArray[1],
CellColumn = col,
IsDetailInfo = IsDetailInfo,
});
}
}
//填充数据
int scale = 1; //不管是否绑定,行都要加1,所以这里默认为1
if (bindList.Count > 0)
{
EmptyCounts = 0; //命中数据行时,清空计数
int ViewCount = this._ds.Tables[bindList[0].TableName].DefaultView.Count; //数据总行数
if (bindList[0].IsDetailInfo && ViewCount > 1) //明细,并且多余1行时,采用插行渲染
{
int InsertRowCount = ViewCount - 1; //本来就有一行,所以:插入行数 = 数据行数 - 1
this.MyInsertRow(sheet, currentRow, InsertRowCount); //从当前行开始,复制当前行的行格式
for (int i = 0; i <= InsertRowCount; i++)
{
foreach (var bind in bindList)
{
ICell cell = sheet?.GetRow(currentRow + i).GetCell(bind.CellColumn);
this.LoadData(cell, bind, RowIndex: i);
}
}
//赋值标量:插入行数大于1时,标量 = 插入行数
if (InsertRowCount > scale)
scale = InsertRowCount;
}
else
{
foreach (ExcelBindModel bind in bindList)
{
ICell cell = sheet?.GetRow(currentRow).GetCell(bind.CellColumn);
this.LoadData(cell, bind);
}
}
}
else
{
EmptyCounts++;
}
//行数累加
currentRow += scale;
}
#endregion
}
/// <summary>
/// 加载单元格数据
/// </summary>
/// <param name="cell"></param>
/// <param name="bind"></param>
/// <param name="RowIndex"></param>
private void LoadData(ICell cell, ExcelBindModel bind, int RowIndex = 0)
{
if (cell == null)
return;
string TableName = bind.TableName; //表名
string ColumnName = bind.ColumnName; //列名
bool IsImage = ColumnName.EndsWith("Image") || ColumnName.EndsWith("Picture"); //图片列规范:必须以Image或Picture结尾,区分大小写
if (this._ds.Tables.Contains(TableName) && this._ds.Tables[TableName].DefaultView.Count > 0 && this._ds.Tables[TableName].Columns.Contains(ColumnName))
{
cell.SetCellValue(""); //先清除单元格信息
var dr = this._ds.Tables[TableName].DefaultView[RowIndex];
if (IsImage)
{
#region 加载图片
//图片列非空,并且是byte[]类型才处理
if (dr[ColumnName] != DBNull.Value && dr[ColumnName].GetType().Name.ToLower().Equals("byte[]"))
{
byte[] bytes = dr[ColumnName] as byte[];
var range = this.GetMergedRange(cell);
this.LoadImage(cell, bytes, range);
}
#endregion
}
else
{
cell.SetCellValue(dr[ColumnName].ToString());
}
}
else
{
//不存在的列名或表名,直接清空
cell.SetCellValue("");
}
}
/// <summary>
/// 绘制图片
/// </summary>
/// <param name="cell"></param>
/// <param name="bytes"></param>
/// <param name="range"></param>
private void LoadImage(ICell cell, byte[] bytes, CellRangeAddress range)
{
//获取单元格对应的Sheet页
ISheet sheet = cell.Sheet as ISheet;
//取出图片宽高
var ms = new MemoryStream(bytes);
Bitmap bmp = new Bitmap(ms);
var height = bmp.Height;
var width = bmp.Width;
// 图片位置空间的高度
short AreaHeight = 0;
for (int i = 1; i <= range.LastRow - range.FirstRow + 1; i++)
AreaHeight += sheet.GetRow(i).Height;
//根据宽高比计算出宽度
int AreaWidth = width * AreaHeight / height;
//获取图片索引
int picIndex = sheet.Workbook.AddPicture(bytes, PictureType.JPEG);
//创建图片锚点
IClientAnchor anchor = null;
if (this.IsXls)
{
anchor = new HSSFClientAnchor()
{
Col1 = range.FirstColumn, //起始列
Col2 = range.LastColumn, //结束列
Row1 = range.FirstRow, //起始行
Row2 = range.LastRow, //结束行
//说明:此处的x和y可看做相对于左上边框的偏移位置;左上(dx1,dy1)和右下(dx2,dy2)分别可看做矩形框的对角顶点,图片在此矩形内绘制
Dx1 = 0,
Dy1 = 0, //起始单元格中的x,y坐标
Dx2 = AreaWidth,
Dy2 = AreaHeight //结束单元格中的x, y坐标
};
}
else
{
anchor = new XSSFClientAnchor()
{
Col1 = range.FirstColumn, //起始列
Col2 = range.LastColumn, //结束列
Row1 = range.FirstRow, //起始行
Row2 = range.LastRow, //结束行
//说明:此处的x和y可看做相对于左上边框的偏移位置;左上(dx1,dy1)和右下(dx2,dy2)分别可看做矩形框的对角顶点,图片在此矩形内绘制
Dx1 = 0,
Dy1 = 0, //起始单元格中的x,y坐标
Dx2 = AreaWidth,
Dy2 = AreaHeight //结束单元格中的x, y坐标
};
}
//绘制图片
IDrawing patriarch = this.GetSheetDrawingObject(sheet);
var pict = (IPicture)patriarch.CreatePicture(anchor, picIndex);
//释放资源
bmp.Dispose();
ms.Close();
}
/// <summary>
/// 获取合并列区域
/// </summary>
/// <param name="CellRow"></param>
/// <param name="CellCol"></param>
/// <returns></returns>
private CellRangeAddress GetMergedRange(ICell cell)
{
CellRangeAddress result = null;
if (cell.IsMergedCell)
{
ISheet sheet = cell.Sheet as ISheet;
for (int i = 0; i < sheet.NumMergedRegions; i++)
{
CellRangeAddress range = sheet.GetMergedRegion(i);
if ((cell.RowIndex >= range.FirstRow && cell.RowIndex <= range.LastRow)
&& (cell.ColumnIndex >= range.FirstColumn && cell.ColumnIndex <= range.LastColumn))
{
result = range;
break;
}
}
}
else
{
int row = cell.RowIndex;
int col = cell.ColumnIndex;
result = new CellRangeAddress(row, row, col, col);
}
return result;
}
/// <summary>
/// 批量插入复制行
/// </summary>
/// <param name="sheet">Excel页</param>
/// <param name="RowStart">起始行</param>
/// <param name="RowCount">(插入)总行数</param>
/// <param name="sourceRow">(复制)源</param>
private void MyInsertRow(ISheet sheet, int RowStart, int RowCount)
{
//插入行数为0时,直接返回
if (RowCount <= 0)
return;
#region 批量移动行
//在当前行前面插入若干空行,所以此时开始行即是最后一行
sheet.ShiftRows(
RowStart, //--开始行
sheet.LastRowNum, //--结束行
RowCount //--插入行数
);
#endregion
#region 创建行,并复制rowSource行的格式
//首行特殊处理,并且后续各行行高要与首行一致
int sourceRowIndex = RowStart + RowCount; //插入行之后的第一行,即是开始行(行号从0开始)
IRow sourceRow = sheet.GetRow(sourceRowIndex) as IRow;
//复制单元格样式(除了第一行,第一行的行已经存在,这里处理未创建的行)
for (int i = RowStart; i < RowStart + RowCount; i++)
{
IRow targetRow = null;
ICell sourceCell = null;
ICell targetCell = null;
targetRow = sheet.CreateRow(i) as IRow;
targetRow.Height = sourceRow.Height; //复制与首行保持一致
for (int m = sourceRow.FirstCellNum; m < sourceRow.LastCellNum; m++)
{
sourceCell = sourceRow.GetCell(m) as ICell;
if (sourceCell == null) continue;
targetCell = targetRow.CreateCell(m) as ICell;
targetCell.CellStyle = sourceCell.CellStyle;
targetCell.SetCellType(sourceCell.CellType);
//合并列处理
if (sourceCell.IsMergedCell)
{
var range = this.GetMergedRange(sourceCell);
//这里的行跨度都是1,所以主要处理列
var newRange = new CellRangeAddress(i, i, range.FirstColumn, range.LastColumn);
sheet.AddMergedRegion(newRange);
}
}
}
            #endregion
        }
/// <summary>
/// 获取Excel文件对象
/// </summary>
/// <param name="mouldFilePath"></param>
/// <returns></returns>
private IWorkbook GetWorkbook(string mouldFilePath)
{
IWorkbook wb = null;
try
{
var fs = new FileStream(mouldFilePath, FileMode.Open, FileAccess.ReadWrite);
if (this.IsXls)
wb = new HSSFWorkbook(fs);
else
wb = new XSSFWorkbook(fs);
fs.Close();
fs.Dispose();
}
catch (Exception ex)
{
Utils.Tip(ex.Message);
}
return wb;
}
/// <summary>
/// 保存Excel文件
/// </summary>
/// <param name="fileName"></param>
private void SaveExcel(string fileName)
{
var fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite);
this._Workbook?.Write(fs);
fs.Close();
fs.Dispose();
}
/// <summary>
/// 获取页面的绘制对象(用于绘制图片)
/// </summary>
/// <param name="sheet"></param>
/// <returns></returns>
private IDrawing GetSheetDrawingObject(ISheet sheet)
{
IDrawing result = null;
try
{
// 第一次取不到居然会有异常抛出...
result = sheet.DrawingPatriarch;
}
catch
{
result = sheet.CreateDrawingPatriarch();
}
return result;
}
}
/// <summary>
/// Excel导出模型
/// </summary>
public class ExportModel
{
/// <summary>
/// 模板唯一前缀(通过该前缀,初始化上下文菜单选项)
/// </summary>
public string UniquePrefix { get; set; }
}
/// <summary>
/// Excel绑定模型
/// </summary>
public class ExcelBindModel
{
/// <summary>
/// 绑定表名
/// </summary>
public string TableName { get; set; }
/// <summary>
/// 绑定列名
/// </summary>
public string ColumnName { get; set; }
/// <summary>
/// 列序号
/// </summary>
public int CellColumn { get; set; }
/// <summary>
/// 是否明细
/// </summary>
public bool IsDetailInfo { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//
using NPOI.XWPF.UserModel;
using System.Data;
using System.IO;
namespace Tools.MyUtils
{
public class NPOIWordHelper
{
/// <summary>
/// 导出Word
/// </summary>
/// <param name="tableName"></param>
/// <param name="tableDescription"></param>
/// <param name="dt"></param>
public void Export(string tableName, string tableDescription, DataTable dt, string exportFileName)
{
XWPFDocument doc = new XWPFDocument();
//段落1:表名
XWPFParagraph paragraph = doc.CreateParagraph();
//paragraph.Alignment = ParagraphAlignment.CENTER;
XWPFRun run = paragraph.CreateRun();
run.IsBold = true;
run.FontSize = 12;
run.SetText($"表名:{tableName}");
run.SetColor("#082E54");
run.SetFontFamily("微软雅黑", FontCharRange.None);
//段落2:表名描述
XWPFParagraph paragraph1 = doc.CreateParagraph();
XWPFRun run1 = paragraph1.CreateRun();
run1.FontSize = 10;
run1.SetText($"描述:{tableDescription}");
run1.SetColor("#808A87");
run1.SetFontFamily("微软雅黑", FontCharRange.None);
//表格:列信息
XWPFTable table = doc.CreateTable(dt.DefaultView.Count + 1, dt.Columns.Count);
for (int i = 0; i < table.Rows.Count; i++)
{
var cells = table.Rows[i].GetTableCells();
for (int n = 0; n < cells.Count; n++)
{
//首行渲染为标题,后续填充值
var text = i.Equals(0) ? dt.Columns[n].Caption : dt.DefaultView[i - 1][n].ToString();
cells[n].SetText(text);
cells[n].SetColor("#FFFFCD");
}
}
try
{
//保存文件
using (var fs = new FileStream(exportFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
doc.Write(fs);
}
}
catch (Exception ex)
{
Utils.Tip("保存出错:\r\n" + ex.Message);
return;
}
finally
{
Utils.Tip("Word导出成功!");
//System.Diagnostics.Process.Start(exportFileName);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//
using System.Windows.Forms;
namespace Tools.MyUtils
{
public static class Utils
{
#region 常用路径
/// <summary>
/// 桌面路径
/// </summary>
public static string DesktopPath => Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
/// <summary>
/// 启动路径
/// </summary>
public static string StartupPath => Application.StartupPath;
/// <summary>
/// 配置文件目录
/// </summary>
public static string ConfigPath => $@"{Application.StartupPath}\config";
/// <summary>
/// 日志目录
/// </summary>
public static string LogPath => $@"{Application.StartupPath}\log";
/// <summary>
/// 暂存目录
/// </summary>
public static string SavePath => $@"{Application.StartupPath}\save";
/// <summary>
/// 临时文件目录
/// </summary>
public static string TempPath => $@"{Application.StartupPath}\temp";
#endregion
/// <summary>
/// 提示框
/// </summary>
/// <param name="msg"></param>
public static void Tip(string msg, int width=0, int height=0)
{
new wMsgBox().Show(msg, width, height);
}
/// <summary>
/// 生成定长序号
/// </summary>
/// <param name="seed">序号</param>
/// <param name="len">长度</param>
/// <returns></returns>
public static string GenSerialNo(int seed, int len = 2)
{
string s = seed.ToString();
if (s.Length < len)
{
s = $"0000{seed}";
s = s.Substring(s.Length - len);
}
return s;
}
/// <summary>
/// 生成数据库链接字符串
/// </summary>
/// <param name="link"></param>
/// <param name="dbName"></param>
/// <param name="userId"></param>
/// <param name="pwd"></param>
/// <returns></returns>
public static string GetLinkString(string link, string dbName, string userId, string pwd)
{
return $"Password={pwd};Persist Security Info=True;User ID={userId};Initial Catalog={dbName};Data Source={link}";
}
/// <summary>
/// 生成数据库链接字符串
/// </summary>
/// <param name="m"></param>
/// <returns></returns>
public static string GetLinkString(DbItemModel m)
{
return GetLinkString(m.Link, m.DbName, m.UserId, m.Pwd);
}
/// <summary>
/// 链接转为模型对象
/// </summary>
/// <param name="linkString"></param>
/// <returns></returns>
public static DbItemModel GetDbItemModel(string linkString)
{
DbItemModel m = new DbItemModel();
var pairs = linkString.Trim().Split(';');
foreach (var p in pairs)
{
var k = p.Trim().Split('=');
if (k.Length < 2)
continue;
if (k[0].Trim().ToLower().Equals("password"))
m.Pwd = k[1];
else if (k[0].Trim().ToLower().Equals("user id"))
m.UserId = k[1];
else if (k[0].Trim().ToLower().Equals("initial catalog"))
m.DbName = k[1];
else if (k[0].Trim().ToLower().Equals("data source"))
m.Link = k[1];
}
return m;
}
#region 生成Model
public static string GenModelHead(string tableName, string tableDescription)
{
var leftBrace = "{";
return $"using System;\r\n\r\nnamespace Tools.Models\r\n{leftBrace}\r\n /// <summary>\r\n ///{tableDescription}\r\n /// </summary>\r\n public class {tableName}\r\n {leftBrace}";
}
public static string GenModelBody(DataTable dt)
{
var leftBrace = "{";
var rightBrace = "}";
var infoList = new List<string>();
foreach (DataRowView r in dt.DefaultView)
{
infoList.Add($" /// <summary>\r\n ///{r["Description"]}\r\n /// </summary>\r\n public {Utils.GetColumnType(r["ColumnType"].ToString())} {r["FieldName"]} {leftBrace} get; set; {rightBrace}");
}
return string.Join("\r\n", infoList);
}
public static string GenModelTail()
{
return " }\r\n}";
}
/// <summary>
/// 获取列类型
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
private static string GetColumnType(string str)
{
str = str.ToUpper();
string result = "string";
if (str.StartsWith("VARCHAR") || str.StartsWith("NVARCHAR"))
{
result = "string";
}
else if (str.StartsWith("DECIMAL"))
{
result = "decimal";
}
else if (str.Equals("INT")) //INT、BIGINT
{
result = "int";
}
else if (str.Equals("BIT"))
{
result = "bool";
}
else if (str.Equals("IMAGE"))
{
result = "byte[]";
}
else if (str.Equals("FLOAT"))
{
result = "float";
}
else if (str.Equals("DATETIME"))
{
result = "DateTime";
}
else if (str.Equals("UNIQUEIDENTIFIER"))
{
result = "Guid";
}
return result;
}
#endregion
#region 生成SQL
public static string GenSqlHead(string tableName)
{
return $"IF NOT EXISTS(SELECT 1 FROM sys.tables WHERE name = '{tableName}')\r\nBEGIN\r\nCREATE TABLE {tableName}\r\n(";
}
public static string GenSqlBody(DataTable dt,string tableName, string tableDescription, out List<string> descriptionList)
{
//描述信息
descriptionList = new List<string>();
descriptionList.Add($"EXEC [dbo].[sp_tools_AddTableDescription] '{tableName}','{tableDescription}'");
//列信息生成
var columnInfoList = new List<string>();
foreach (DataRowView r in dt.DefaultView)
{
var columninfo = string.Empty;
//列名与类型
var FieldName = r["FieldName"].ToString();
var ColumnType = r["ColumnType"].ToString();
columninfo = $"{FieldName} {ColumnType}";
//是否为空
var IsNotNull = r["IsNotNull"] == DBNull.Value ? false : (bool)r["IsNotNull"];
columninfo += IsNotNull ? " NOT NULL" : " NULL";
//是否主键
var IsPrimaryKey = r["IsPrimaryKey"] == DBNull.Value ? false : (bool)r["IsPrimaryKey"];
columninfo += IsPrimaryKey ? " PRIMARY KEY" : "";
//是否自增
var IsAutoIncrement = r["IsAutoIncrement"] == DBNull.Value ? false : (bool)r["IsAutoIncrement"];
columninfo += IsAutoIncrement && (ColumnType.Equals("INT") || ColumnType.Equals("BIGINT")) ? " IDENTITY(1,1)" : "";
//默认值
var DefaultValue = r["DefaultValue"].ToString();
columninfo += string.IsNullOrEmpty(DefaultValue) ? "" : $" DEFAULT({DefaultValue})";
columnInfoList.Add(columninfo);
//创建描述
var Description = r["Description"].ToString();
descriptionList.Add($"EXEC [dbo].[sp_tools_AddTableClumnDescription] '{tableName}','{FieldName}','{Description}'");
}
return string.Join(",\r\n", columnInfoList);
}
public static string GenSqlTail()
{
return $");\r\nEND;";
}
#endregion
}
}
namespace Tools.MyUtils
{
partial class wDbSetting
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.tbLink = new System.Windows.Forms.TextBox();
this.tbDbName = new System.Windows.Forms.TextBox();
this.tbUserId = new System.Windows.Forms.TextBox();
this.tbPwd = new System.Windows.Forms.TextBox();
this.btnSave = new System.Windows.Forms.Button();
this.lnkHistory = new System.Windows.Forms.LinkLabel();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(28, 27);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(53, 12);
this.label1.TabIndex = 0;
this.label1.Text = "链 接:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(28, 53);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(53, 12);
this.label2.TabIndex = 1;
this.label2.Text = "数据库:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(28, 79);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(53, 12);
this.label3.TabIndex = 2;
this.label3.Text = "账 号:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(28, 105);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(53, 12);
this.label4.TabIndex = 3;
this.label4.Text = "密 码:";
//
// tbLink
//
this.tbLink.Location = new System.Drawing.Point(87, 24);
this.tbLink.Name = "tbLink";
this.tbLink.Size = new System.Drawing.Size(168, 21);
this.tbLink.TabIndex = 4;
//
// tbDbName
//
this.tbDbName.Location = new System.Drawing.Point(87, 50);
this.tbDbName.Name = "tbDbName";
this.tbDbName.Size = new System.Drawing.Size(168, 21);
this.tbDbName.TabIndex = 5;
//
// tbUserId
//
this.tbUserId.Location = new System.Drawing.Point(87, 76);
this.tbUserId.Name = "tbUserId";
this.tbUserId.Size = new System.Drawing.Size(168, 21);
this.tbUserId.TabIndex = 6;
//
// tbPwd
//
this.tbPwd.Location = new System.Drawing.Point(87, 102);
this.tbPwd.Name = "tbPwd";
this.tbPwd.PasswordChar = '*';
this.tbPwd.Size = new System.Drawing.Size(168, 21);
this.tbPwd.TabIndex = 7;
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(115, 137);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 23);
this.btnSave.TabIndex = 8;
this.btnSave.Text = "保存设置";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// lnkHistory
//
this.lnkHistory.AutoSize = true;
this.lnkHistory.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
this.lnkHistory.LinkColor = System.Drawing.Color.DodgerBlue;
this.lnkHistory.Location = new System.Drawing.Point(28, 142);
this.lnkHistory.Name = "lnkHistory";
this.lnkHistory.Size = new System.Drawing.Size(53, 12);
this.lnkHistory.TabIndex = 9;
this.lnkHistory.TabStop = true;
this.lnkHistory.Text = "历史记录";
this.lnkHistory.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkHistory_LinkClicked);
//
// wDbSetting
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(288, 172);
this.Controls.Add(this.lnkHistory);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.tbPwd);
this.Controls.Add(this.tbUserId);
this.Controls.Add(this.tbDbName);
this.Controls.Add(this.tbLink);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "wDbSetting";
this.Text = "数据库设置";
this.Load += new System.EventHandler(this.wDbSetting_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox tbLink;
private System.Windows.Forms.TextBox tbDbName;
private System.Windows.Forms.TextBox tbUserId;
private System.Windows.Forms.TextBox tbPwd;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.LinkLabel lnkHistory;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//
using Tools.MyCommon;
using Tools.MyData;
namespace Tools.MyUtils
{
public partial class wDbSetting : wBasic
{
/// <summary>
/// 数据库链接字符串
/// </summary>
public DbItemModel LinkModel { get; private set; }
SmpDB _db = new SmpDB();
DataTable _dt = null;
string link_cfg = $@"{Utils.ConfigPath}\links.xml";
string Link => this.tbLink.Text.Trim();
string DbName => this.tbDbName.Text.Trim();
string UserId => this.tbUserId.Text.Trim();
string Pwd => this.tbPwd.Text.Trim();
public wDbSetting()
{
InitializeComponent();
this.MinimizeBox = false;
this.MaximizeBox = false;
this.DialogResult = DialogResult.None;
}
private void wDbSetting_Load(object sender, EventArgs e)
{
//定义表结构
this._dt = new DataTable("links")
{
Columns = {
{ "Link" , typeof(string) },
{ "DbName" , typeof(string) },
{ "UserId" , typeof(string) },
{ "Pwd" , typeof(string) },
},
};
//如果存在则读取
if (File.Exists(link_cfg))
{
this._dt.ReadXml(link_cfg);
}
}
/// <summary>
/// 保存设置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnSave_Click(object sender, EventArgs e)
{
//检查链接
this.LinkModel = new DbItemModel { Link = this.Link, DbName = this.DbName, UserId = this.UserId, Pwd = this.Pwd };
if (!this._db.ConnectionTest(this.LinkModel.LinkString))
{
Utils.Tip("数据库链接无效请检查!");
return;
}
//保存历史
var drArray = this._dt.Select($"Link='{this.Link}' and DbName='{this.DbName}' and UserId='{this.UserId}' and Pwd='{this.Pwd}'");
if (drArray.Length == 0)
{
this._dt.Rows.Add(new object[] { this.Link, this.DbName, this.UserId, this.Pwd });
}
this._dt.WriteXml(link_cfg);
//关闭窗口
this.DialogResult = DialogResult.OK;
this.Close();
}
/// <summary>
/// 历史记录
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void lnkHistory_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
var menu = new ContextMenu();
var items = this._dt.Rows.OfType<DataRow>()
.Select(r =>
new DbItemModel
{
Link = r["Link"].ToString(),
DbName = r["DbName"].ToString(),
UserId = r["UserId"].ToString(),
Pwd = r["Pwd"].ToString()
});
;
menu.MenuItems.AddRange(items.Select(m => new MenuItem(m.ToString(), Item_Click) { Tag = m }).ToArray());
menu.Show(this.lnkHistory, new Point(0, this.lnkHistory.Height));
}
/// <summary>
/// 历史记录项点击
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Item_Click(object sender, EventArgs e)
{
var m = (sender as MenuItem).Tag as DbItemModel;
this.tbLink.Text = m.Link;
this.tbDbName.Text = m.DbName;
this.tbUserId.Text = m.UserId;
this.tbPwd.Text = m.Pwd;
}
}
public class DbItemModel
{
public string Link { get; set; }
public string DbName { get; set; }
public string UserId { get; set; }
public string Pwd { get; set; }
public string LinkString => Utils.GetLinkString(this);
public override string ToString()
{
return $"{this.DbName}({this.Link})";
}
}
}
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
namespace Tools.MyUtils
{
partial class wMsgBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnDefault = new System.Windows.Forms.Button();
this.tbMessage = new System.Windows.Forms.TextBox();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Controls.Add(this.btnDefault, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.tbMessage, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 4;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 2F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 2F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(240, 128);
this.tableLayoutPanel1.TabIndex = 0;
//
// btnDefault
//
this.btnDefault.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnDefault.Location = new System.Drawing.Point(73, 95);
this.btnDefault.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btnDefault.Name = "btnDefault";
this.btnDefault.Size = new System.Drawing.Size(94, 27);
this.btnDefault.TabIndex = 1;
this.btnDefault.Text = "确 定";
this.btnDefault.UseVisualStyleBackColor = true;
//
// tbMessage
//
this.tableLayoutPanel1.SetColumnSpan(this.tbMessage, 3);
this.tbMessage.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbMessage.Location = new System.Drawing.Point(3, 3);
this.tbMessage.Multiline = true;
this.tbMessage.Name = "tbMessage";
this.tbMessage.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.tbMessage.Size = new System.Drawing.Size(234, 83);
this.tbMessage.TabIndex = 2;
//
// wMsgBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(240, 128);
this.Controls.Add(this.tableLayoutPanel1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "wMsgBox";
this.Text = "提示";
this.Load += new System.EventHandler(this.wMsgBox_Load);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Button btnDefault;
private System.Windows.Forms.TextBox tbMessage;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//
using Tools.MyCommon;
namespace Tools.MyUtils
{
public partial class wMsgBox : wBasic
{
public wMsgBox()
{
InitializeComponent();
//窗体初始化
this.ShowInTaskbar = false;
//this.MaximizeBox = false;
this.MinimizeBox = false;
this.DialogResult = DialogResult.None;
}
private void wMsgBox_Load(object sender, EventArgs e)
{
this.btnDefault.Click += BtnDefault_Click;
}
private void BtnDefault_Click(object sender, EventArgs e)
{
this.Close();
}
/// <summary>
/// 显示消息窗口(最小256*167)
/// </summary>
/// <param name="msg"></param>
public void Show(string msg, int width = 256, int height = 167)
{
if (width > 256)
this.Width = width;
if (height > 167)
this.Height = height;
this.tbMessage.Text = msg;
this.ShowDialog();
}
}
}
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Tools
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new UI.wDBTools());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("FTT-Tools")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FTT-Tools")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("c5ab3ce9-c46a-467d-96e4-d80dd3bbb239")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Tools.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 global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tools.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap excel {
get {
object obj = ResourceManager.GetObject("excel", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap sql {
get {
object obj = ResourceManager.GetObject("sql", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap word {
get {
object obj = ResourceManager.GetObject("word", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 使用说明 {
get {
object obj = ResourceManager.GetObject("使用说明", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 实体类 {
get {
object obj = ResourceManager.GetObject("实体类", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 导出 {
get {
object obj = ResourceManager.GetObject("导出", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 恢复 {
get {
object obj = ResourceManager.GetObject("恢复", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 数据库 {
get {
object obj = ResourceManager.GetObject("数据库", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 暂存 {
get {
object obj = ResourceManager.GetObject("暂存", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 更新 {
get {
object obj = ResourceManager.GetObject("更新", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 查询 {
get {
object obj = ResourceManager.GetObject("查询", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 类 {
get {
object obj = ResourceManager.GetObject("类", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="excel" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\excel.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sql" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sql.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="word" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\word.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="使用说明" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\使用说明.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="实体类" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\实体类.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="导出" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\导出.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="恢复" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\恢复.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="数据库" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\数据库.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="暂存" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\暂存.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="更新" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\更新.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="查询" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\查询.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="类" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\类.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Tools.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.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 {
return defaultInstance;
}
}
}
}
<?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>
<?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>{C5AB3CE9-C46A-467D-96E4-D80DD3BBB239}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Tools</RootNamespace>
<AssemblyName>Tools</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\AppHome\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.6.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.6\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=1.2.0.246, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.1.2.0\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="NPOI, Version=2.5.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<HintPath>..\packages\NPOI.2.5.1\lib\net45\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML, Version=2.5.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<HintPath>..\packages\NPOI.2.5.1\lib\net45\NPOI.OOXML.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXml4Net, Version=2.5.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<HintPath>..\packages\NPOI.2.5.1\lib\net45\NPOI.OpenXml4Net.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXmlFormats, Version=2.5.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<HintPath>..\packages\NPOI.2.5.1\lib\net45\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<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.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MyCommon\wBasic.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MyCommon\wBasic.Designer.cs">
<DependentUpon>wBasic.cs</DependentUpon>
</Compile>
<Compile Include="MyData\SmpDB.cs" />
<Compile Include="MyUtils\wDbSetting.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MyUtils\wDbSetting.Designer.cs">
<DependentUpon>wDbSetting.cs</DependentUpon>
</Compile>
<Compile Include="MyUtils\NPOIExcelHelper.cs" />
<Compile Include="MyUtils\NPOIWordHelper.cs" />
<Compile Include="MyUtils\Utils.cs" />
<Compile Include="MyUtils\wMsgBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MyUtils\wMsgBox.Designer.cs">
<DependentUpon>wMsgBox.cs</DependentUpon>
</Compile>
<Compile Include="UI\wDBTools.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\wDBTools.Designer.cs">
<DependentUpon>wDBTools.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MyCommon\wBasic.resx">
<DependentUpon>wBasic.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MyUtils\wDbSetting.resx">
<DependentUpon>wDbSetting.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MyUtils\wMsgBox.resx">
<DependentUpon>wMsgBox.cs</DependentUpon>
</EmbeddedResource>
<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>
<EmbeddedResource Include="UI\wDBTools.resx">
<DependentUpon>wDBTools.cs</DependentUpon>
</EmbeddedResource>
<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>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\更新.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\导出.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\实体类.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\excel.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\word.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\查询.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\暂存.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\恢复.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\数据库.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\sql.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\类.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\使用说明.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
\ No newline at end of file
namespace Tools.UI
{
partial class wDBTools
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.tsmiExportModel = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiExportSql = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiExportExcel = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiExportWord = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.tsbTempSave = new System.Windows.Forms.ToolStripButton();
this.tsbResume = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.tsbDbLink = new System.Windows.Forms.ToolStripButton();
this.tstbDbLink = new System.Windows.Forms.ToolStripTextBox();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.tsbHelp = new System.Windows.Forms.ToolStripButton();
this.dgvData = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewComboBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.tsmiAddRow = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiDelRow = new System.Windows.Forms.ToolStripMenuItem();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.tbTableName = new System.Windows.Forms.TextBox();
this.tbTableDescription = new System.Windows.Forms.TextBox();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
this.contextMenuStrip1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripDropDownButton1,
this.toolStripSeparator2,
this.tsbTempSave,
this.tsbResume,
this.toolStripSeparator1,
this.tsbDbLink,
this.tstbDbLink,
this.toolStripSeparator3,
this.tsbHelp});
this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow;
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(933, 24);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripDropDownButton1
//
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiExportModel,
this.tsmiExportSql,
this.tsmiExportExcel,
this.tsmiExportWord});
this.toolStripDropDownButton1.Image = global::Tools.Properties.Resources.导出;
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(85, 21);
this.toolStripDropDownButton1.Text = "导出文件";
//
// tsmiExportModel
//
this.tsmiExportModel.Image = global::Tools.Properties.Resources.类;
this.tsmiExportModel.Name = "tsmiExportModel";
this.tsmiExportModel.Size = new System.Drawing.Size(123, 22);
this.tsmiExportModel.Text = "实体类";
//
// tsmiExportSql
//
this.tsmiExportSql.Image = global::Tools.Properties.Resources.sql;
this.tsmiExportSql.Name = "tsmiExportSql";
this.tsmiExportSql.Size = new System.Drawing.Size(123, 22);
this.tsmiExportSql.Text = "SQL文件";
//
// tsmiExportExcel
//
this.tsmiExportExcel.Image = global::Tools.Properties.Resources.excel;
this.tsmiExportExcel.Name = "tsmiExportExcel";
this.tsmiExportExcel.Size = new System.Drawing.Size(123, 22);
this.tsmiExportExcel.Text = "Excel";
//
// tsmiExportWord
//
this.tsmiExportWord.Image = global::Tools.Properties.Resources.word;
this.tsmiExportWord.Name = "tsmiExportWord";
this.tsmiExportWord.Size = new System.Drawing.Size(123, 22);
this.tsmiExportWord.Text = "Word";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 23);
//
// tsbTempSave
//
this.tsbTempSave.Image = global::Tools.Properties.Resources.暂存;
this.tsbTempSave.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbTempSave.Name = "tsbTempSave";
this.tsbTempSave.Size = new System.Drawing.Size(52, 21);
this.tsbTempSave.Text = "暂存";
//
// tsbResume
//
this.tsbResume.Image = global::Tools.Properties.Resources.恢复;
this.tsbResume.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbResume.Name = "tsbResume";
this.tsbResume.Size = new System.Drawing.Size(76, 21);
this.tsbResume.Text = "恢复暂存";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 23);
//
// tsbDbLink
//
this.tsbDbLink.Image = global::Tools.Properties.Resources.数据库;
this.tsbDbLink.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDbLink.Name = "tsbDbLink";
this.tsbDbLink.Size = new System.Drawing.Size(88, 21);
this.tsbDbLink.Text = "数据库配置";
//
// tstbDbLink
//
this.tstbDbLink.Enabled = false;
this.tstbDbLink.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.tstbDbLink.Name = "tstbDbLink";
this.tstbDbLink.Size = new System.Drawing.Size(100, 23);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 23);
//
// tsbHelp
//
this.tsbHelp.Image = global::Tools.Properties.Resources.使用说明;
this.tsbHelp.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbHelp.Name = "tsbHelp";
this.tsbHelp.Size = new System.Drawing.Size(76, 21);
this.tsbHelp.Text = "使用说明";
//
// dgvData
//
this.dgvData.BackgroundColor = System.Drawing.SystemColors.Window;
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvData.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column1,
this.Column6,
this.Column2,
this.Column3,
this.Column4,
this.Column7,
this.Column5});
this.tableLayoutPanel1.SetColumnSpan(this.dgvData, 8);
this.dgvData.ContextMenuStrip = this.contextMenuStrip1;
this.dgvData.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvData.Location = new System.Drawing.Point(3, 31);
this.dgvData.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.dgvData.Name = "dgvData";
this.tableLayoutPanel1.SetRowSpan(this.dgvData, 2);
this.dgvData.RowTemplate.Height = 23;
this.dgvData.Size = new System.Drawing.Size(927, 516);
this.dgvData.TabIndex = 1;
//
// Column1
//
this.Column1.DataPropertyName = "FieldName";
this.Column1.HeaderText = "字段";
this.Column1.Name = "Column1";
//
// Column6
//
this.Column6.DataPropertyName = "Description";
this.Column6.HeaderText = "说明";
this.Column6.Name = "Column6";
//
// Column2
//
this.Column2.DataPropertyName = "ColumnType";
this.Column2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.Column2.HeaderText = "类型";
this.Column2.Items.AddRange(new object[] {
"",
"INT",
"VARCHAR(50)",
"DATETIME",
"IMAGE",
"BIT",
"VARCHAR(MAX)",
"UNIQUEIDENTIFIER",
"DECIMAL(19,6)",
"DECIMAL(18,2)",
"FLOAT",
"NVARCHAR(50)",
"NVARCHAR(MAX)"});
this.Column2.Name = "Column2";
this.Column2.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.Column2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.Column2.Width = 150;
//
// Column3
//
this.Column3.DataPropertyName = "IsNotNull";
this.Column3.HeaderText = "非空";
this.Column3.Name = "Column3";
this.Column3.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.Column3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// Column4
//
this.Column4.DataPropertyName = "IsPrimaryKey";
this.Column4.HeaderText = "主键";
this.Column4.Name = "Column4";
this.Column4.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.Column4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// Column7
//
this.Column7.DataPropertyName = "IsAutoIncrement";
this.Column7.HeaderText = "自增";
this.Column7.Name = "Column7";
this.Column7.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// Column5
//
this.Column5.DataPropertyName = "DefaultValue";
this.Column5.HeaderText = "默认值";
this.Column5.Name = "Column5";
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiAddRow,
this.tsmiDelRow});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(101, 48);
//
// tsmiAddRow
//
this.tsmiAddRow.Name = "tsmiAddRow";
this.tsmiAddRow.Size = new System.Drawing.Size(100, 22);
this.tsmiAddRow.Text = "増行";
//
// tsmiDelRow
//
this.tsmiDelRow.Name = "tsmiDelRow";
this.tsmiDelRow.Size = new System.Drawing.Size(100, 22);
this.tsmiDelRow.Text = "删行";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 8;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.Controls.Add(this.dgvData, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label2, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.tbTableName, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.tbTableDescription, 3, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(933, 551);
this.tableLayoutPanel1.TabIndex = 2;
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(69, 27);
this.label1.TabIndex = 2;
this.label1.Text = "表名:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Location = new System.Drawing.Point(236, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(69, 27);
this.label2.TabIndex = 3;
this.label2.Text = "描述:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tbTableName
//
this.tbTableName.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbTableName.Location = new System.Drawing.Point(78, 3);
this.tbTableName.Name = "tbTableName";
this.tbTableName.Size = new System.Drawing.Size(152, 23);
this.tbTableName.TabIndex = 4;
//
// tbTableDescription
//
this.tbTableDescription.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbTableDescription.Location = new System.Drawing.Point(311, 3);
this.tbTableDescription.Name = "tbTableDescription";
this.tbTableDescription.Size = new System.Drawing.Size(152, 23);
this.tbTableDescription.TabIndex = 5;
//
// wDBTools
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(933, 575);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.toolStrip1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "wDBTools";
this.Text = "数据库开发工具";
this.Load += new System.EventHandler(this.wDBTools_Load);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
this.contextMenuStrip1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.DataGridView dgvData;
private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1;
private System.Windows.Forms.ToolStripMenuItem tsmiExportExcel;
private System.Windows.Forms.ToolStripMenuItem tsmiExportWord;
private System.Windows.Forms.ToolStripMenuItem tsmiExportModel;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem tsmiDelRow;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripButton tsbTempSave;
private System.Windows.Forms.ToolStripButton tsbResume;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox tbTableName;
private System.Windows.Forms.TextBox tbTableDescription;
private System.Windows.Forms.ToolStripMenuItem tsmiExportSql;
private System.Windows.Forms.ToolStripMenuItem tsmiAddRow;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private System.Windows.Forms.DataGridViewComboBoxColumn Column2;
private System.Windows.Forms.DataGridViewCheckBoxColumn Column3;
private System.Windows.Forms.DataGridViewCheckBoxColumn Column4;
private System.Windows.Forms.DataGridViewCheckBoxColumn Column7;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripButton tsbHelp;
private System.Windows.Forms.ToolStripButton tsbDbLink;
private System.Windows.Forms.ToolStripTextBox tstbDbLink;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//
using Tools.MyCommon;
using Tools.MyData;
using Tools.MyUtils;
namespace Tools.UI
{
public partial class wDBTools : wBasic
{
string ConfigPath = $@"{Utils.ConfigPath}\sys_cfg.xml";
/// <summary>
/// 数据库访问对象
/// </summary>
SmpDB _db = new SmpDB();
/// <summary>
/// 全局数据源
/// </summary>
DataSet _ds = null;
/// <summary>
/// 数据库链接
/// </summary>
string _link = "";
/// <summary>
/// 系统配置
/// </summary>
Dictionary<string, string> dicConfig = null;
/// <summary>
/// 基础信息表
/// </summary>
string baseTable => "base";
/// <summary>
/// 明细信息表
/// </summary>
string infoTable => "info";
/// <summary>
/// 表的名称
/// </summary>
string TableName => this.tbTableName.Text.Trim();
/// <summary>
/// 表的描述
/// </summary>
string TableDescription => this.tbTableDescription.Text.Trim();
public wDBTools()
{
InitializeComponent();
}
private void wDBTools_Load(object sender, EventArgs e)
{
this.InitSystem();
this.InitData();
this.InitUI();
}
private void InitSystem()
{
DataTable dtSetting = null;
if (File.Exists(this.ConfigPath))
{
dtSetting = new DataTable("AppSetting");
dtSetting.ReadXml(this.ConfigPath);
}
else
{
#region 结构初始化
dtSetting = new DataTable("AppSetting")
{
Columns = {
{ "Name", typeof(string) },
{ "Value", typeof(string) },
},
Rows = {
{ "LinkString", "Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=Temp;Data Source=." },
{ "ExportPath", "" },
},
};
dtSetting.PrimaryKey = new DataColumn[] { dtSetting.Columns[0] };
dtSetting.WriteXml(this.ConfigPath, XmlWriteMode.WriteSchema);
#endregion
}
//保存到全局字典对象
dicConfig = dtSetting.Rows.Cast<DataRow>().ToDictionary(x => x["Name"].ToString(), x => x["Value"].ToString());
}
private void InitData()
{
#region 数据结构定义
//数据集结构初始化
this._ds = new DataSet();
this._ds.Tables.Add(new DataTable(baseTable)
{
Columns = {
{ "TableName", typeof(string) },
{ "TableDescription", typeof(string) },
},
Rows = {
{ DBNull.Value, DBNull.Value },
},
});
this._ds.Tables.Add(new DataTable(infoTable)
{
Columns = {
{ "FieldName", typeof(string) },
{ "Description", typeof(string) },
{ "ColumnType", typeof(string) },
{ "IsNotNull", typeof(bool) },
{ "IsPrimaryKey", typeof(bool) },
{ "IsAutoIncrement", typeof(bool) },
{ "DefaultValue", typeof(string) },
},
//Rows = {
// { "ID", "主键", "VARCHAR(50)", DBNull.Value, DBNull.Value, DBNull.Value, "" },
//},
});
//设置主键
this._ds.Tables[infoTable].PrimaryKey = new DataColumn[] { this._ds.Tables[infoTable].Columns[0] };
//生成数据结构配置文件
//var cfg = $@"{Utils.ConfigPath}\data_struct_cfg.xml";
//if (!File.Exists(cfg))
//{
// this._ds.WriteXml(cfg, XmlWriteMode.WriteSchema);
//}
#endregion
}
private void InitUI()
{
//初始化数据库链接
this._link = dicConfig["LinkString"];
this.tstbDbLink.Text = Utils.GetDbItemModel(this._link).ToString();
//基本信息绑定
this.BindBaseInfo();
//数据表格初始化
this.dgvData.AutoGenerateColumns = false;
this.dgvData.AllowUserToAddRows = false;
this.dgvData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
this.dgvData.DataSource = this._ds.Tables[infoTable];
this.dgvData.KeyUp += DgvData_KeyUp;
this.dgvData.CellValueChanged += DgvData_CellValueChanged;
//工具栏-事件
this.tsmiExportModel.Click += TsmiExportModel_Click;
this.tsmiExportSql.Click += TsmiExportSql_Click;
this.tsmiExportExcel.Click += TsmiExportExcel_Click;
this.tsmiExportWord.Click += TsmiExportWord_Click;
this.tsbTempSave.Click += TsbTempSave_Click;
this.tsbResume.Click += TsbResume_Click;
this.tsbDbLink.Click += TsbDbLink_Click;
this.tsbHelp.Click += TsbHelp_Click;
//上下文菜单-事件
this.tsmiAddRow.Click += TsmiAddRow_Click;
this.tsmiDelRow.Click += TsmiDelRow_Click;
}
private void BindBaseInfo()
{
this.tbTableName.DataBindings.Clear();
this.tbTableDescription.DataBindings.Clear();
this.tbTableName.DataBindings.Add("Text", this._ds.Tables[baseTable].DefaultView[0], "TableName");
this.tbTableDescription.DataBindings.Add("Text", this._ds.Tables[baseTable].DefaultView[0], "TableDescription"); ;
}
#region 数据表格-事件
private void DgvData_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode.Equals(Keys.Insert))
{
if (this.dgvData.CurrentRow != null)
{
var index = this.dgvData.CurrentRow.Index;
if (index >= 0 && index < this._ds.Tables[infoTable].DefaultView.Count)
{
var drNew = GetInfoNewRow();
this._ds.Tables[infoTable].Rows.InsertAt(drNew, index);
}
}
else
{
this.TsmiAddRow_Click(null, null);
}
}
}
private void DgvData_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
}
#endregion
#region 工具栏-事件
private void TsmiExportModel_Click(object sender, EventArgs e)
{
if (!this.CheckDetail())
return;
try
{
var head = Utils.GenModelHead(this.TableName, this.TableDescription);
var body = Utils.GenModelBody(this._ds.Tables[infoTable]);
var tail = Utils.GenModelTail();
var model = $"{head}\r\n{body}\r\n{tail}";
var modelFileName = $@"{this.GetExportPath()}\{this.TableName}.cs";
using (var fs = new FileStream(modelFileName, FileMode.Create, FileAccess.Write, FileShare.Read))
{
var bytes = Encoding.UTF8.GetBytes(model);
fs.Write(bytes, 0, bytes.Length);
}
Utils.Tip("模型类导出成功!");
//Process.Start(modelFileName);
}
catch (Exception ex)
{
Utils.Tip("导出实体类出错:\r\n" + ex.Message);
return;
}
}
private void TsmiExportSql_Click(object sender, EventArgs e)
{
if (!this.CheckDetail())
return;
if (string.IsNullOrEmpty(this._link))
{
Utils.Tip("数据库链接未配置,请先设置!");
return;
}
try
{
//初始化SQL依赖
this.InitSqlDepend();
//生成SQL文件
var head = Utils.GenSqlHead(this.TableName);
var body = Utils.GenSqlBody(this._ds.Tables[infoTable], this.TableName, this.TableDescription, out List<string> descripionList);
var tail = Utils.GenSqlTail();
var sql = $"{head}\r\n{body}\r\n{tail}\r\n{string.Join(";\r\n", descripionList)}";
var sqlFileName = $@"{this.GetExportPath()}\{this.TableName}.sql";
using (var fs = new FileStream(sqlFileName, FileMode.Create, FileAccess.Write, FileShare.Read))
{
var bytes = Encoding.UTF8.GetBytes(sql);
fs.Write(bytes, 0, bytes.Length);
}
//执行SQL
this._db.ExecNonSql(this._link, new List<string> { sql });
Utils.Tip("Sql生成并执行成功!");
//Process.Start(sqlFileName);
}
catch (Exception ex)
{
Utils.Tip(ex.Message);
return;
}
}
private void TsmiExportExcel_Click(object sender, EventArgs e)
{
if (!this.CheckDetail())
return;
new NPOIExcelHelper().Export(this._ds, $@"{Utils.ConfigPath}\模板.xlsx", $@"{this.GetExportPath()}\{this.TableName}.xlsx");
}
private void TsmiExportWord_Click(object sender, EventArgs e)
{
if (!CheckDetail())
return;
///设置标题:方便表格渲染
foreach (DataGridViewColumn col in this.dgvData.Columns)
{
var fieldName = col.DataPropertyName;
if (string.IsNullOrEmpty(fieldName) || !this._ds.Tables[infoTable].Columns.Contains(fieldName))
continue;
this._ds.Tables[infoTable].Columns[fieldName].Caption = col.HeaderText;
}
//导出Word
new NPOIWordHelper().Export(this.TableName, this.TableDescription, this._ds.Tables[infoTable], $@"{this.GetExportPath()}\{this.TableName}.docx");
}
private void TsbTempSave_Click(object sender, EventArgs e)
{
if (!this.CheckDetail())
return;
this._ds.WriteXml($@"{Utils.SavePath}\{this.tbTableName.Text}-{DateTime.Now.ToString("yyyyMMdd")}.xml");
Utils.Tip("暂存成功");
}
private void TsbResume_Click(object sender, EventArgs e)
{
var dlg = new OpenFileDialog();
dlg.InitialDirectory = Utils.SavePath;
dlg.Filter = "xml|*.xml";
dlg.Title = "选择缓存文件";
if (dlg.ShowDialog() == DialogResult.OK)
{
//清空当前数据源
foreach (DataTable dt in this._ds.Tables)
{
dt.Clear();
}
//读取缓存数据源
this._ds.ReadXml(dlg.FileName);
//重新绑定基础信息
this.BindBaseInfo();
}
}
private void TsbDbLink_Click(object sender, EventArgs e)
{
var w = new wDbSetting();
if (w.ShowDialog() == DialogResult.OK)
{
this._link = w.LinkModel.LinkString;
this.tstbDbLink.Text = w.LinkModel.ToString();
}
}
private void TsbHelp_Click(object sender, EventArgs e)
{
var helpFileName = $@"{Utils.ConfigPath}\help.txt";
if (File.Exists(helpFileName))
{
using (var sr = new StreamReader(helpFileName))
{
Utils.Tip(sr.ReadToEnd(), 450, 300);
}
}
}
#endregion
#region 上下文-事件
private void TsmiAddRow_Click(object sender, EventArgs e)
{
var drNew = this.GetInfoNewRow();
this._ds.Tables[infoTable].Rows.Add(drNew);
}
private void TsmiDelRow_Click(object sender, EventArgs e)
{
var index = this.dgvData.CurrentRow.Index;
if (index >= 0 && index < this._ds.Tables[infoTable].DefaultView.Count)
{
this._ds.Tables[infoTable].DefaultView[index].Delete();
}
}
#endregion
/// <summary>
/// 明细检查
/// </summary>
/// <returns></returns>
private bool CheckDetail()
{
//检查基本信息
if (this.TableName.Equals(""))
{
Utils.Tip("请输入表名!");
return false;
}
if (this.TableDescription.Equals(""))
{
Utils.Tip("请输入表的描述信息!");
return false;
}
//结束编辑
this.dgvData.CommitEdit(DataGridViewDataErrorContexts.Display);
foreach (System.Collections.DictionaryEntry item in this.BindingContext)
{
var bm = (item.Value as WeakReference).Target as BindingManagerBase;
if (bm != null)
{
bm.EndCurrentEdit();
}
}
//检查明细信息
foreach (DataRowView r in this._ds.Tables[infoTable].DefaultView)
{
if (string.IsNullOrEmpty(r["FieldName"].ToString()) || string.IsNullOrEmpty(r["ColumnType"].ToString()))
{
Utils.Tip("列名或类型不能为空,请检查!");
return false;
}
}
return true;
}
/// <summary>
/// 创建明细新行
/// </summary>
/// <returns></returns>
private DataRow GetInfoNewRow()
{
var str = this._ds.Tables[infoTable].Compute("MAX(FieldName)", "FieldName like 'NewField%'").ToString();
var max = string.IsNullOrEmpty(str) ? 0 : int.Parse(str.Replace("NewField", ""));
var drNew = this._ds.Tables[infoTable].NewRow();
drNew["FieldName"] = $"NewField{Utils.GenSerialNo(max+1)}";
drNew["ColumnType"] = "VARCHAR(50)";
drNew.EndEdit();
return drNew;
}
/// <summary>
/// 获取导出路径
/// </summary>
/// <returns></returns>
private string GetExportPath()
{
string path = "";
if (dicConfig != null)
{
path = dicConfig["ExportPath"]?.Trim();
}
if (string.IsNullOrEmpty(path))
{
path = Utils.TempPath;
}
return path;
}
/// <summary>
/// 初始化SQL依赖
/// </summary>
private void InitSqlDepend()
{
//依赖SQL:依赖的存储过程或表
var pathList = Directory.GetFiles($@"{Utils.ConfigPath}\InitSql", "*.sql").ToList();
pathList.Sort();
List<string> sqlist = new List<string>();
foreach (var path in pathList)
{
using (var sr = new StreamReader(path, Encoding.Default))
{
var sql = sr.ReadToEnd();
if (string.IsNullOrEmpty(sql))
continue;
var sqls = sql.Split(new string[] { "go", "Go", "GO" }, StringSplitOptions.RemoveEmptyEntries);
sqlist.AddRange(sqls);
}
}
//执行SQL语句
this._db.ExecNonSql(this._link, sqlist);
}
}
}
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>56</value>
</metadata>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NPOI" version="2.5.1" targetFramework="net461" />
<package id="Portable.BouncyCastle" version="1.8.6" targetFramework="net461" />
<package id="SharpZipLib" version="1.2.0" targetFramework="net461" />
</packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment