From afbf8700d137710713db61955879d0f5acb73738 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期四, 11 七月 2024 15:55:58 +0800 Subject: [PATCH] 测试 --- .gitignore | 1 CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.resx | 169 +++ CSFramework.DB.Source/CSFramework.DBTester/CSFramework.DBTester.csproj | 116 ++ CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Program.cs | 16 CSFramework.DB.Source/CSFramework.DBV2.0.sln | 31 CSFramework.DB.Source/CSFramework.DBTester/Class1.cs | 12 CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.resx | 120 ++ CSFramework.DB.Source/CSFramework.DBTester/Properties/AssemblyInfo.cs | 36 CSFrameworkV5.Core/CSFrameworkV5.Core.sln | 41 CSFramework.DB.Source/CSFramework.DBTester/sys_AdminUser.cs | 34 CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.Designer.cs | 248 ++++ CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/CSFrameworkV5.Core.Tester.csproj | 60 + CSFramework.DB.Source/CSFramework.DBTester/sys_Log.cs | 41 CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Tester.cs | 52 + CSFramework.DB.Source/CSFramework.DBTester/sys_RegisterLog.cs | 24 CSFramework.DB.Source/CSFramework.DBTester/logo.ico | 0 CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/App.config | 6 CSFramework.DB.Source/CSFramework.DBTester/_TestDataUpdate.cs | 107 ++ CSFramework.DB.Source/CSFramework.DBTester/Properties/Settings.settings | 7 CSFramework.DB.Source/CSFramework.DBTester/App.config | 42 CSFramework.DB.Source/CSFramework.DBTester/Properties/Resources.resx | 117 ++ CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.Designer.cs | 470 +++++++++ CSFramework.DB.Source/CSFramework.DBTester/Program.cs | 87 + CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.cs | 332 ++++++ CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.cs | 737 ++++++++++++++ CSFramework.DB.Source/CSFramework.DBTester/Properties/Resources.Designer.cs | 63 + CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Properties/AssemblyInfo.cs | 36 CSFramework.DB.Source/CSFramework.DBTester/Properties/Settings.Designer.cs | 26 28 files changed, 3,031 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 1c38a68..a36e5ea 100644 --- a/.gitignore +++ b/.gitignore @@ -184,3 +184,4 @@ # Microsoft Fakes FakesAssemblies/ +/CSFrameworkV5.ClientFoundation/.idea/.idea.CSFrameworkV5-ClientFoundation/.idea diff --git a/CSFramework.DB.Source/CSFramework.DBTester/App.config b/CSFramework.DB.Source/CSFramework.DBTester/App.config new file mode 100644 index 0000000..930d2c6 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/App.config @@ -0,0 +1,42 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> + </startup> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/> + <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0"/> + </dependentAssembly> + </assemblyBinding> + </runtime> + <system.data> + <DbProviderFactories> + <add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" + type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + + <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" + type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> + + <add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" + type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + + <add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" + type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/> + + <remove invariant="Oracle.ManagedDataAccess.Client"/> + <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" + type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/> + + <add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" + type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" + type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.58.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/> + + </DbProviderFactories> + + </system.data> +</configuration> + + diff --git a/CSFramework.DB.Source/CSFramework.DBTester/CSFramework.DBTester.csproj b/CSFramework.DB.Source/CSFramework.DBTester/CSFramework.DBTester.csproj new file mode 100644 index 0000000..eb0cfff --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/CSFramework.DBTester.csproj @@ -0,0 +1,116 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="14.0" DefaultTargets="Build" 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>{EBE7B1E8-6D76-43A2-A765-653847F0CC8B}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>CSFramework.DBTester</RootNamespace> + <AssemblyName>CSFramework.DBTester</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <TargetFrameworkProfile /> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> + </PropertyGroup> + <PropertyGroup> + <ApplicationIcon>logo.ico</ApplicationIcon> + </PropertyGroup> + <ItemGroup> + <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.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Class1.cs" /> + <Compile Include="frmSQLConcurrentTester.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="frmSQLConcurrentTester.Designer.cs"> + <DependentUpon>frmSQLConcurrentTester.cs</DependentUpon> + </Compile> + <Compile Include="frmTestDB.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="frmTestDB.Designer.cs"> + <DependentUpon>frmTestDB.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="sys_AdminUser.cs" /> + <Compile Include="sys_Log.cs" /> + <Compile Include="sys_RegisterLog.cs" /> + <Compile Include="_TestDataUpdate.cs" /> + <EmbeddedResource Include="frmSQLConcurrentTester.resx"> + <DependentUpon>frmSQLConcurrentTester.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="frmTestDB.resx"> + <DependentUpon>frmTestDB.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> + <None Include="App.config" /> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + </ItemGroup> + <ItemGroup> + <Content Include="logo.ico" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\CSFramework.DB\CSFramework.DB.csproj"> + <Project>{8ae59d09-994c-4e82-bec7-69c5977b659f}</Project> + <Name>CSFramework.DB</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file diff --git a/CSFramework.DB.Source/CSFramework.DBTester/Class1.cs b/CSFramework.DB.Source/CSFramework.DBTester/Class1.cs new file mode 100644 index 0000000..95b3a0d --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/Class1.cs @@ -0,0 +1,12 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CSFramework.DBTester +{ + class Class1 + { + } +} diff --git a/CSFramework.DB.Source/CSFramework.DBTester/Program.cs b/CSFramework.DB.Source/CSFramework.DBTester/Program.cs new file mode 100644 index 0000000..612cfb3 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/Program.cs @@ -0,0 +1,87 @@ +锘縰sing CSFramework.DB; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace CSFramework.DBTester +{ + static class Program + { + /// <summary> + /// 搴旂敤绋嬪簭鐨勪富鍏ュ彛鐐广�� + /// </summary> + [STAThread] + static void Main() + { + Application.ThreadException += Application_ThreadException; + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + + + + ////isid鏄嚜澧炲瓧娈� + //sys_Log log = new sys_Log + //{ + // DocNo = "doc0123412341234", + // GUID32 = "2345234523452435", + // LogDate = DateTime.Now, + // LogUser = "admin", + // OPType = 1, + //}; + + var conn = "Server=.;Database=CSFrameworkV5_Normal;User ID=sa;Password=test; Max Pool Size=512; Pooling=true;Connect Timeout=30"; + IDatabase db = DatabaseFactory.CreateSqlDatabase(conn); + var list = db.meta_GetStoreProcList(); + return; + + ////瀹炰緥鍖朌bCommand鐢熸垚鍣� + //DbCommandGenerator g = new DbCommandGenerator(db); + + ////娴嬭瘯妗堜緥1 - 鑾峰彇鏍囪瘑鏈夌壒鎬�(Attribute)鐨勫瓧娈� + //var list = g.GetAttributeFields(typeof(sys_Log), typeof(KeyField)); + //var list2 = g.GetAttributeFields(typeof(sys_Log), typeof(IgnoreField)); + + ////娴嬭瘯妗堜緥2 + //var m5 = g.GetTableName(typeof(sys_Log)); + //var m1 = g.GetDeleteCommand(typeof(sys_Log)); + //var m2 = g.GetDeleteCommand<sys_Log>(log); + //var m3 = g.GetInsertCommand(typeof(sys_Log)); + //var m4 = g.GetInsertCommand<sys_Log>(log); + //var m6 = g.GetUpdateCommand(typeof(sys_Log)); + //var m7 = g.GetUpdateCommand<sys_Log>(log); + + //new DbFramework(db).AddObject<sys_Log>(log, new string[] { "isid", "DocNo" });//鏃х殑浣跨敤鏂规硶 + //new DbFramework(db).AddObject<sys_Log>(log, "isid", "DocNo"); //鏂版柟娉曪細params 鍙傛暟褰㈠紡 + //List<sys_Log> list2 = new DbFramework(db).Select<sys_Log>();//鏂板鍔熻兘锛氳繑鍥炴墍鏈夊璞� + //sys_Log one = new DbFramework(db).Select<sys_Log>("isid", 1);//鏂板鍔熻兘锛氭牴鎹叧閿瓧杩斿洖涓�涓璞� + + + + //byte[] ts = new byte[] { 0, 0, 0, 0, 0, 20, 12, 229 }; + + + //var s = TimeStampTool.TimestampToString(ts); + + //var st = TimeStampTool.strToHexByte(s); + + //var d1 = TimeStampTool.FromBytes(ts); + + //long lo = Math.Abs(BitConverter.ToInt64(ts, 0)); + //var ss = TimeSpan.FromTicks(lo); + + //string sql = "select * from aaa姹夊瓧琛�"; + //if (sql.Substring(sql.Length - 1, 1) != ";") sql = sql + ";"; + + Application.Run(new frmTestDB()); + //Application.Run(new frmSQLConcurrentTester()); + } + + + + private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) + { + MessageBox.Show(e.Exception.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } +} diff --git a/CSFramework.DB.Source/CSFramework.DBTester/Properties/AssemblyInfo.cs b/CSFramework.DB.Source/CSFramework.DBTester/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d0a99b3 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +锘縰sing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅 +// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼 +// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭�� +[assembly: AssemblyTitle("CSFramework.DBTester")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("CSFramework.DBTester")] +[assembly: AssemblyCopyright("Copyright 漏 Microsoft 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +//灏� ComVisible 璁剧疆涓� false 灏嗕娇姝ょ▼搴忛泦涓殑绫诲瀷 +//瀵� COM 缁勪欢涓嶅彲瑙併�� 濡傛灉闇�瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷锛� +//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规�ц缃负 true銆� +[assembly: ComVisible(false)] + +// 濡傛灉姝ら」鐩悜 COM 鍏紑锛屽垯涓嬪垪 GUID 鐢ㄤ簬绫诲瀷搴撶殑 ID +[assembly: Guid("ebe7b1e8-6d76-43a2-a765-653847f0cc8b")] + +// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�: +// +// 涓荤増鏈� +// 娆$増鏈� +// 鐢熸垚鍙� +// 淇鍙� +// +//鍙互鎸囧畾鎵�鏈夎繖浜涘�硷紝涔熷彲浠ヤ娇鐢ㄢ�滅敓鎴愬彿鈥濆拰鈥滀慨璁㈠彿鈥濈殑榛樿鍊硷紝 +// 鏂规硶鏄寜濡備笅鎵�绀轰娇鐢ㄢ��*鈥�: : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CSFramework.DB.Source/CSFramework.DBTester/Properties/Resources.Designer.cs b/CSFramework.DB.Source/CSFramework.DBTester/Properties/Resources.Designer.cs new file mode 100644 index 0000000..8784f95 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +锘�//------------------------------------------------------------------------------ +// <auto-generated> +// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆� +// 杩愯鏃剁増鏈�:4.0.30319.42000 +// +// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳戒細瀵艰嚧涓嶆纭殑琛屼负锛屽苟涓斿鏋� +// 閲嶆柊鐢熸垚浠g爜锛岃繖浜涙洿鏀瑰皢浼氫涪澶便�� +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace CSFramework.DBTester.Properties { + using System; + + + /// <summary> + /// 涓�涓己绫诲瀷鐨勮祫婧愮被锛岀敤浜庢煡鎵炬湰鍦板寲鐨勫瓧绗︿覆绛夈�� + /// </summary> + // 姝ょ被鏄敱 StronglyTypedResourceBuilder + // 绫婚�氳繃绫讳技浜� ResGen 鎴� Visual Studio 鐨勫伐鍏疯嚜鍔ㄧ敓鎴愮殑銆� + // 鑻ヨ娣诲姞鎴栫Щ闄ゆ垚鍛橈紝璇风紪杈� .ResX 鏂囦欢锛岀劧鍚庨噸鏂拌繍琛� ResGen + // (浠� /str 浣滀负鍛戒护閫夐」)锛屾垨閲嶆柊鐢熸垚 VS 椤圭洰銆� + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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("CSFramework.DBTester.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// 浣跨敤姝ゅ己绫诲瀷璧勬簮绫伙紝涓烘墍鏈夎祫婧愭煡鎵� + /// 閲嶅啓褰撳墠绾跨▼鐨� CurrentUICulture 灞炴�с�� + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/CSFramework.DB.Source/CSFramework.DBTester/Properties/Resources.resx b/CSFramework.DB.Source/CSFramework.DBTester/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/Properties/Resources.resx @@ -0,0 +1,117 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file diff --git a/CSFramework.DB.Source/CSFramework.DBTester/Properties/Settings.Designer.cs b/CSFramework.DB.Source/CSFramework.DBTester/Properties/Settings.Designer.cs new file mode 100644 index 0000000..535da53 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +锘�//------------------------------------------------------------------------------ +// <auto-generated> +// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆� +// 杩愯鏃剁増鏈�:4.0.30319.42000 +// +// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳戒細瀵艰嚧涓嶆纭殑琛屼负锛屽苟涓斿鏋� +// 閲嶆柊鐢熸垚浠g爜锛岃繖浜涙洿鏀瑰皢浼氫涪澶便�� +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace CSFramework.DBTester.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.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; + } + } + } +} diff --git a/CSFramework.DB.Source/CSFramework.DBTester/Properties/Settings.settings b/CSFramework.DB.Source/CSFramework.DBTester/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/Properties/Settings.settings @@ -0,0 +1,7 @@ +锘�<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile> diff --git a/CSFramework.DB.Source/CSFramework.DBTester/_TestDataUpdate.cs b/CSFramework.DB.Source/CSFramework.DBTester/_TestDataUpdate.cs new file mode 100644 index 0000000..3263a76 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/_TestDataUpdate.cs @@ -0,0 +1,107 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +/*=================================================================== + * 绋嬪簭璇存槑: tb__TestDataUpdate鐨凮RM妯″瀷 + * 浣滆�呰祫鏂�: 瀛欎腑鍚� + * 鍒涘缓鏃ユ湡: 2021-06-11 02:13:50 + * 鏈�鍚庝慨鏀�: 2021-06-11 02:13:50 + * + * 娉�: 鏈枃浠剁敱浠g爜鐢熸垚鍣�(Code Generator)鑷姩鐢熸垚銆� + * (姝ゆ簮鐮佹枃浠惰鏀剧疆鍦� YourProject.Models 妯″潡)銆� + * 鐗堟潈鎵�鏈� Copyright 2006~2021, C/S妗嗘灦缃�(www.cscode.net) + *===================================================================*/ + +namespace CSFramework.DBTester +{ + ///<summary> + /// ORM妯″瀷, 鏁版嵁琛�:_TestDataUpdate,鐢盋lassGenerator鑷姩鐢熸垚 + /// </summary> + public class _TestDataUpdate + { + #region 鎵�鏈夊瓧娈靛睘鎬� + + public System.Int32 isid { get; set; } + + public System.Byte[] _Binary { get; set; } + + public System.DateTimeOffset _DateTimeOffset { get; set; } + + public System.Object _Sql_variant { get; set; } + + public System.String _Xml { get; set; } + + public System.Guid _UniqueIdentifier { get; set; } + + public System.String _Geometry { get; set; } + + public System.DateTime _Timestamp { get; set; } + + public System.Int32 _Int { get; set; } + + public System.Byte[] _Varbinary { get; set; } + + public System.Boolean _Bit { get; set; } + + public System.Char _Char { get; set; } + + public System.DateTime _Datetime2 { get; set; } + + public System.String _Geography { get; set; } + + public System.String _Hierarchyid { get; set; } + + public System.Byte[] _Image { get; set; } + + public System.String _Ntext { get; set; } + + #endregion + } + + /// <summary> + /// mysql娴嬭瘯 + /// </summary> + public class _testdataupdate + { + + #region 鎵�鏈夊瓧娈靛睘鎬� + + public System.Int32 isid { get; set; } + + public System.Byte[] _BinaryCHAR { get; set; } + + public System.Object _Sql_variant { get; set; } + + public System.String _Json { get; set; } + + public System.String _UniqueIdentifier { get; set; } + + public System.String _Geometry { get; set; } + + public System.DateTime _Timestamp { get; set; } + + public System.Int32 _Int { get; set; } + + public System.Byte[] _Varbinary { get; set; } + + public System.Boolean _Bit { get; set; } + + public System.Char _Char { get; set; } + + public System.DateTime _Datetime { get; set; } + + public System.String _Geography { get; set; } + + public System.String _Hierarchyid { get; set; } + + public System.Byte[] _Image { get; set; } + + public System.String _Ntext { get; set; } + + #endregion + } +} + + diff --git a/CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.Designer.cs b/CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.Designer.cs new file mode 100644 index 0000000..8b51240 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.Designer.cs @@ -0,0 +1,248 @@ +锘縩amespace CSFramework.DBTester +{ + partial class frmSQLConcurrentTester + { + /// <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(frmSQLConcurrentTester)); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.rbConnLocal = new System.Windows.Forms.RadioButton(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.chkPooling = new System.Windows.Forms.RadioButton(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.pb = new System.Windows.Forms.ProgressBar(); + this.lblTime = new System.Windows.Forms.Label(); + this.btnTest = new System.Windows.Forms.Button(); + this.label4 = new System.Windows.Forms.Label(); + this.txtResult = new System.Windows.Forms.TextBox(); + this.lblProgress = new System.Windows.Forms.Label(); + this.txtConns = new System.Windows.Forms.TextBox(); + this.txtThreads = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtRunThreads = new System.Windows.Forms.TextBox(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.chkPooling); + this.groupBox1.Controls.Add(this.radioButton2); + this.groupBox1.Controls.Add(this.rbConnLocal); + this.groupBox1.Location = new System.Drawing.Point(12, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(635, 63); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + // + // rbConnLocal + // + this.rbConnLocal.AutoSize = true; + this.rbConnLocal.Checked = true; + this.rbConnLocal.Location = new System.Drawing.Point(18, 26); + this.rbConnLocal.Name = "rbConnLocal"; + this.rbConnLocal.Size = new System.Drawing.Size(83, 16); + this.rbConnLocal.TabIndex = 0; + this.rbConnLocal.TabStop = true; + this.rbConnLocal.Text = "鏈湴鏁版嵁搴�"; + this.rbConnLocal.UseVisualStyleBackColor = true; + // + // radioButton2 + // + this.radioButton2.AutoSize = true; + this.radioButton2.Location = new System.Drawing.Point(142, 26); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(113, 16); + this.radioButton2.TabIndex = 1; + this.radioButton2.Text = "闃块噷浜慐CS鏈嶅姟鍣�"; + this.radioButton2.UseVisualStyleBackColor = true; + // + // chkPooling + // + this.chkPooling.AutoSize = true; + this.chkPooling.Location = new System.Drawing.Point(281, 26); + this.chkPooling.Name = "chkPooling"; + this.chkPooling.Size = new System.Drawing.Size(179, 16); + this.chkPooling.TabIndex = 1; + this.chkPooling.Text = "鍚敤杩炴帴姹狅紙Pooling=True锛�"; + this.chkPooling.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(69, 79); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(83, 12); + this.label1.TabIndex = 1; + this.label1.Text = "SQL杩炴帴鏁版嵁锛�"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(15, 105); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(137, 12); + this.label2.TabIndex = 1; + this.label2.Text = "妯℃嫙鐢ㄦ埛绔紙绾跨▼锛夋暟锛�"; + // + // pb + // + this.pb.Location = new System.Drawing.Point(227, 74); + this.pb.Name = "pb"; + this.pb.Size = new System.Drawing.Size(420, 49); + this.pb.TabIndex = 2; + // + // lblTime + // + this.lblTime.AutoSize = true; + this.lblTime.Location = new System.Drawing.Point(152, 415); + this.lblTime.Name = "lblTime"; + this.lblTime.Size = new System.Drawing.Size(41, 12); + this.lblTime.TabIndex = 1; + this.lblTime.Text = "鐢ㄦ椂锛�"; + // + // btnTest + // + this.btnTest.Image = ((System.Drawing.Image)(resources.GetObject("btnTest.Image"))); + this.btnTest.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnTest.Location = new System.Drawing.Point(227, 129); + this.btnTest.Name = "btnTest"; + this.btnTest.Size = new System.Drawing.Size(119, 43); + this.btnTest.TabIndex = 3; + this.btnTest.Text = " 寮�濮嬫祴璇�"; + this.btnTest.UseVisualStyleBackColor = true; + this.btnTest.Click += new System.EventHandler(this.btnTest_Click); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(83, 181); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(65, 12); + this.label4.TabIndex = 1; + this.label4.Text = "绾跨▼淇℃伅锛�"; + // + // txtResult + // + this.txtResult.Location = new System.Drawing.Point(154, 178); + this.txtResult.Multiline = true; + this.txtResult.Name = "txtResult"; + this.txtResult.ReadOnly = true; + this.txtResult.Size = new System.Drawing.Size(493, 226); + this.txtResult.TabIndex = 4; + // + // lblProgress + // + this.lblProgress.AutoSize = true; + this.lblProgress.Font = new System.Drawing.Font("瀹嬩綋", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblProgress.Location = new System.Drawing.Point(566, 129); + this.lblProgress.Name = "lblProgress"; + this.lblProgress.Size = new System.Drawing.Size(28, 14); + this.lblProgress.TabIndex = 1; + this.lblProgress.Text = "0/0"; + // + // txtConns + // + this.txtConns.Location = new System.Drawing.Point(154, 74); + this.txtConns.Name = "txtConns"; + this.txtConns.Size = new System.Drawing.Size(67, 21); + this.txtConns.TabIndex = 5; + this.txtConns.Text = "10000"; + // + // txtThreads + // + this.txtThreads.Location = new System.Drawing.Point(154, 102); + this.txtThreads.Name = "txtThreads"; + this.txtThreads.Size = new System.Drawing.Size(67, 21); + this.txtThreads.TabIndex = 5; + this.txtThreads.Text = "150"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(75, 132); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(77, 12); + this.label3.TabIndex = 1; + this.label3.Text = "宸插惎鍔ㄧ嚎绋嬶細"; + // + // txtRunThreads + // + this.txtRunThreads.Location = new System.Drawing.Point(154, 129); + this.txtRunThreads.Name = "txtRunThreads"; + this.txtRunThreads.ReadOnly = true; + this.txtRunThreads.Size = new System.Drawing.Size(67, 21); + this.txtRunThreads.TabIndex = 5; + this.txtRunThreads.Text = "0"; + // + // frmSQLConcurrentTester + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(699, 446); + this.Controls.Add(this.txtRunThreads); + this.Controls.Add(this.txtThreads); + this.Controls.Add(this.txtConns); + this.Controls.Add(this.txtResult); + this.Controls.Add(this.btnTest); + this.Controls.Add(this.pb); + this.Controls.Add(this.lblProgress); + this.Controls.Add(this.label4); + this.Controls.Add(this.label2); + this.Controls.Add(this.lblTime); + this.Controls.Add(this.label3); + this.Controls.Add(this.label1); + this.Controls.Add(this.groupBox1); + this.Name = "frmSQLConcurrentTester"; + this.Text = "C/S鏋舵瀯蹇�熷紑鍙戞鏋禨QL骞跺彂娴嬭瘯鍘嬪姏娴嬭瘯锛�2021鐗堬級"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.RadioButton chkPooling; + private System.Windows.Forms.RadioButton radioButton2; + private System.Windows.Forms.RadioButton rbConnLocal; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ProgressBar pb; + private System.Windows.Forms.Label lblTime; + private System.Windows.Forms.Button btnTest; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txtResult; + private System.Windows.Forms.Label lblProgress; + private System.Windows.Forms.TextBox txtConns; + private System.Windows.Forms.TextBox txtThreads; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtRunThreads; + } +} \ No newline at end of file diff --git a/CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.cs b/CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.cs new file mode 100644 index 0000000..37e172c --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.cs @@ -0,0 +1,332 @@ +锘縰sing CSFramework.DB; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace CSFramework.DBTester +{ + /// <summary> + /// C/S妗嗘灦缃戯紝CSFramework.DB锛孋/S妗嗘灦鏁版嵁搴撳苟鍙戞祴璇� + /// </summary> + public partial class frmSQLConcurrentTester : Form + { + + static object _threadCount = 0;//绾跨▼鏁伴噺 + static object _connCount = 0;//宸插缓绔嬬殑SQL杩炴帴鏁� + static List<object> _threadList = new List<object>();//绾跨▼鏁伴噺 + static DateTime _startTime = DateTime.Now; + + static List<String> _DocNos = new List<string>();//鏈娴嬭瘯鐢熸垚鐨勫崟鎹彿鐮� + + static object _ThreadFinish = 0; + + static object _Rows_Inserted = 0; + static object _Rows_Updated = 0; + static object _Rows_Deleted = 0; + static object _Failed = 0; + + public frmSQLConcurrentTester() + { + InitializeComponent(); + } + + private void btnTest_Click(object sender, EventArgs e) + { + txtResult.Text = ""; + + OnResult("寮�濮嬫祴璇�..."); + btnTest.Enabled = false; + + _connCount = 0; + _threadCount = 0; + _Failed = 0; + _ThreadFinish = 0; + _Rows_Inserted = 0; + _Rows_Updated = 0; + _Rows_Deleted = 0; + _startTime = DateTime.Now; + _DocNos.Clear(); + + //鍒濆鍖栬繘搴︽潯 + this.DoPrepareProgress(); + + //鍚姩澶氱嚎绋� + int t = int.Parse(txtThreads.Text); + int count = 1; + while (count <= t) + { + Task.Run(() => { DoThread(); }); + Application.DoEvents(); + count++; + } + + //绛夊緟鍏ㄩ儴绾跨▼瀹屾垚澶勭悊 + Thread.Sleep(1000); //蹇呴』绛夊緟绗�1涓嚎绋� + WaitThreads(); + + OnResult($"鏈娴嬭瘯鐢ㄦ埛鏁版嵁, Insert={_Rows_Inserted},Update={_Rows_Updated},Delete={_Rows_Deleted},澶辫触鏁�={_Failed}"); + + OnResult("娴嬭瘯缁撴潫..."); + + TimeSpan ts = DateTime.Now - _startTime; + lblTime.Text = "鐢ㄦ椂锛�" + ts.TotalSeconds.ToString() + "绉�."; + + btnTest.Enabled = true; + btnTest.Invalidate(); + + GC.Collect();//鍥炴敹鍨冨溇 + } + + /// <summary> + /// 绛夊緟绾跨▼ + /// </summary> + private void WaitThreads() + { + while (int.Parse(_ThreadFinish.ToString()) < int.Parse(txtThreads.Text)) + { + //澶勭悊绾跨▼.... + Application.DoEvents(); + } + } + + /// <summary> + /// 鍚姩涓�涓嚎绋� + /// </summary> + private void DoThread() + { + try + { + //绾跨▼浠诲姟璁℃暟鍣� + lock (_threadCount) + { + _threadCount = int.Parse(_threadCount.ToString()) + 1; + } + + int currentID = int.Parse(_threadCount.ToString()); + if (currentID > int.Parse(txtThreads.Text)) return; + + lock (_threadList) _threadList.Add(currentID); + + this.Invoke(new SyncCall(this.OnResult), new object[] { "寮�濮嬬嚎绋嬶細" + currentID.ToString() }); + + string connStr = ""; + + //鏈湴杩炴帴 + if (rbConnLocal.Checked) + connStr = "Server =.; Database = CSFrameworkV5_Normal; User ID = sa; Password = test;"; + else//杩滅▼杩炴帴 + connStr = "Server =120.77.22.34; Database = CSFrameworkV5_Normal; User ID = sa; Password = test;"; + + //鍚姩绾跨▼姹� + if (chkPooling.Checked) + connStr = connStr + "pooling = true; connection lifetime = 0; min pool size = 1; max pool size = 32767"; + else + connStr = connStr + "pooling = false; "; + + string SQL = "INSERT INTO tb_QO(QONO,DocDate,CustomerCode,RefPONO,Currency,Sales,CreationDate,CreatedBy,LastUpdateDate,LastUpdatedBy)" + + "VALUES(@QONO, @DocDate, @CustomerCode, @RefPONO, @Currency, @Sales, @CreationDate, @CreatedBy, @LastUpdateDate, @LastUpdatedBy)"; + + string SQL1 = "UPDATE tb_QO SET Client=@Client,Remark=@Remark,LastUpdateDate=@LastUpdateDate WHERE QONO=@QONO"; + + string SQL2 = "DELETE tb_QO WHERE QONO=@QONO"; + + int sub_total = 0; + int go = 0; + CommandHelper cmd = null; + + while (int.Parse(_connCount.ToString()) < int.Parse(txtConns.Text)) + { + + //閿佸畾杩炴帴鏁拌鏃跺櫒+1 + lock (_connCount) + { + _connCount = int.Parse(_connCount.ToString()) + 1; + if (int.Parse(_connCount.ToString()) > int.Parse(txtConns.Text)) + break; + } + + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, connStr); + + //鎶界锛実o<=10锛屾ā鎷�1涓敤鎴锋柊澧炰竴鏉℃暟鎹� + // go>10<=20锛屾ā鎷�1涓敤鎴烽殢鏈烘洿鏂颁竴鏉℃暟鎹� + // go>=20锛屾ā鎷�1涓敤鎴烽殢鏈哄垹闄や竴鏉℃暟鎹� + Thread.Sleep(100); + go = new Random().Next(1, 30); + + //鏂板璁板綍 + if (go <= 10 || _DocNos.Count < 1) + { + cmd = db.CreateCommand(SQL); + + cmd.AddParam("@QONO", GetDocNo()); + cmd.AddParam("@DocDate", DateTime.Now); + cmd.AddParam("@CustomerCode", DateTime.Now.ToString("yyyyMMddHHmmssfff")); + cmd.AddParam("@RefPONO", DateTime.Now.ToString("yyyyMMddHHmmssfff")); + cmd.AddParam("@Currency", "RMB"); + cmd.AddParam("@Sales", "admin"); + cmd.AddParam("@CreationDate", DateTime.Now); + cmd.AddParam("@CreatedBy", "admin"); + cmd.AddParam("@LastUpdatedBy", "admin"); + cmd.AddParam("@LastUpdateDate", DateTime.Now); + + int i = db.ExecuteCommand(cmd.Command); + if (i > 0) + { + //鎵ц鍛戒护锛氬鐞嗙殑璁板綍鏁� + lock (_Rows_Inserted) + { + _Rows_Inserted = int.Parse(_Rows_Inserted.ToString()) + 1; + } + } + } + + //淇敼璁板綍 + if (go > 10 && go <= 20) + { + cmd = db.CreateCommand(SQL1); + cmd.AddParam("@QONO", GetDocNoExists()); + cmd.AddParam("@Client", "csframework.com"); + cmd.AddParam("@Remark", "鐢ㄦ埛鏇存柊浜嗘暟鎹�"); + cmd.AddParam("@LastUpdateDate", DateTime.Now); + + int i = db.ExecuteCommand(cmd.Command); + + //鎵ц鍛戒护锛氬鐞嗙殑璁板綍鏁� + lock (_Rows_Updated) + { + _Rows_Updated = int.Parse(_Rows_Updated.ToString()) + 1; + } + + } + + //鍒犻櫎璁板綍 + if (go > 20 && go <= 30) + { + cmd = db.CreateCommand(SQL2); + cmd.AddParam("@QONO", GetDocNoExists()); + + //鎵ц鍛戒护锛氬鐞嗙殑璁板綍鏁� + int i = db.ExecuteCommand(cmd.Command); + + lock (_Rows_Deleted) + { + _Rows_Deleted = int.Parse(_Rows_Deleted.ToString()) + 1;//浠呯粺璁″垹闄ゆ垚鍔熺殑璁板綍 + } + + } + + sub_total++; + + if (cmd != null) cmd.Command.Dispose(); + + db = null; + + //閫氱煡澶勭悊1娆� + this.Invoke(new SyncCall(this.OnProgress), new object[] { 1 }); + + } + + lock (_threadList) _threadList.Remove(currentID); + + lock (_ThreadFinish) _ThreadFinish = int.Parse(_ThreadFinish.ToString()) + 1; + + //閫氱煡浜嬩欢锛氱嚎绋嬪鐞嗗畬鎴� + this.Invoke(new SyncCall(this.OnResult), new object[] { $"绾跨▼<{currentID}>缁撴潫,鍏卞鐞嗭細{sub_total}涓猄QL杩炴帴!" }); + + Application.DoEvents(); + } + catch (Exception ex) + { + this.Invoke(new SyncCall(this.OnResult), new object[] { "閿欒锛�" + ex.Message }); + + lock (_ThreadFinish) _ThreadFinish = int.Parse(_ThreadFinish.ToString()) + 1; + lock (_Failed) _Failed = int.Parse(_Failed.ToString()) + 1; + } + } + + private string GetDocNoExists() + { + lock (_DocNos) + { + int i = new Random().Next(1, _DocNos.Count); + return _DocNos[i - 1]; + } + } + + /// <summary> + /// 鍒濆鍖栬繘搴︽潯 + /// </summary> + private void DoPrepareProgress() + { + lblProgress.Text = "0/0"; + pb.Minimum = 0; + pb.Maximum = int.Parse(txtConns.Text); + pb.Value = 0; + } + + /// <summary> + /// 鑾峰彇鍗曟嵁鍙风爜 + /// </summary> + /// <returns></returns> + private string GetDocNo() + { + Thread.Sleep(5); + var docNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + Guid.NewGuid().ToString().ToLower().Replace("-", "").Substring(0, 10); + lock (_DocNos) + { + _DocNos.Add(docNo); + } + return docNo; + } + + /// <summary> + /// 鏄剧ず缁撴灉淇℃伅 + /// </summary> + /// <param name="value"></param> + private void OnResult(object value) + { + string text = value.ToString(); + txtResult.AppendText(text + "\r\n"); + txtResult.ScrollToCaret(); + + if (text.IndexOf("寮�濮嬬嚎绋�") >= 0) + txtRunThreads.Text = _threadCount.ToString(); + } + + /// <summary> + /// 鏇存柊杩涘害鏉� + /// </summary> + /// <param name="value"></param> + private void OnProgress(object value) + { + if (pb.Value + 1 <= pb.Maximum) + { + pb.Value++; + + lblProgress.Text = pb.Value.ToString() + "/" + pb.Maximum.ToString(); + + TimeSpan ts = DateTime.Now - _startTime; + lblTime.Text = "鐢ㄦ椂锛�" + ts.TotalSeconds.ToString() + "绉�."; + } + else + { + + } + } + } + + /// <summary> + /// 寮傛璋冪敤杩囩▼ + /// </summary> + /// <param name="value"></param> + public delegate void SyncCall(object value); + + +} diff --git a/CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.resx b/CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.resx new file mode 100644 index 0000000..979ec53 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.resx @@ -0,0 +1,169 @@ +锘�<?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="btnTest.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAARdEVYdFRpdGxlAEJ1ZztSZXBvcnQ7sbAXPQAACbNJREFUWEfFV2lQVFcWfiCiSJQYkDWpmYwK + 9ArddDdNNw10g80WEFHZREChZZMtgCgCIiBhl5ZFRZElGJMYo8RCR0xcMJrEWHGcTBwTjYlxNJPFZGZ+ + TNWkkvrm3Ed0ujMVxn9zqj4e575zz/fd0/ee280B+L/C2pnBlEERINQHBBq8yLUh2FpC7K/1Evtp6oUS + 9cyJyKw4LZ2sDk8uvkjICeWx/wWF2iBSqMOZgAbKYU+YQ5j7M+aIpOoGgThwu48gQEy+zS/nR5l8aHja + LDmtnMw2d677YC7nI1FxGuNaLiRmPaeP38DmsFXaSWS6QKki4r5AFnNGKIu5SYnBngJZ9FmBVHf/d0v9 + NBTHxM0i2ITGrue0xgw+36rNbjQ0bZacVk5Gizu3+/UCLi41kpMHx7PYh6W295ZErCTCb5ShyViWmI/Y + tOexMrsaz6WV8b4yNAVCecy3S0T6ZIqfR7Bj8+XBy7mYJAO3umYhudNmyWnlpDe7cf1HCrjtfZks7hG5 + r39UpzRwOcJX5CEuvRzZFZ2oaB7Ctu7D9Bzm/bg15Yig9yzOR2rsonlPEGazPFs6k7hVWx5DwJomV67/ + tQKqQj6Lmyb3i9zhp16BZSsLEJ1SgrwtvahsHkNp4yg21g+htGmERIyhqG4AsamliKA4Fu8tXdZG85kI + vhKJVY8hIK3BlTMajTZSpWb2U66u9iKVNl6sjIM+3kQCCrGurB2FdfuRW70XeVsHHoH5+TX7+PdMaBjF + s3k+MlWSi7v7AqG/0pHysn3BmyWnlZNav4iTSNR22tDYf2kM+uIV5V635Zow6KIzEJ1cguyqPqyv6EH2 + pj6YNvXDVLUbOVX9yCF/XUUv/d+HmORS6KIyINOEIjrP/Y4yOLhapTX+oFSGOwRqjDMLSNrmwvn4qWap + dVE5xlT5jxu7JOg+lAWNIRRG+nzXFncis3Qnssq6kVVufoTM57uRUdpF77v4uCB9CDoPpsG0wwf6lZIf + 6eiWLBEHzFVpls0sYHWNM3s/a6Gz+/zETS7fNI5Gwjy+HEferkBty2Z+ZWyFq0z1SM7bgfSidqTkNWN1 + znbaH9Mrr23ZhMNvl6D3eAK2DeoRW+D0YKGLh4ejoyM7nmxjW3FaO9MBdlG5TpGZDb/B9lE9usdjMXI+ + HVfvDOPKx6/BPNCGrPwiJKTlQG1YjRX0zCTfPNCKKzcP49oXwxi7kIHeiTg0jhmQssUD6kSHBMrrQGAb + 25rTypkWYB9b/GTDxk4p6kaCsPN4NIbOp+Dd22ZcuzeEm18fw53vT+Pe3y9ic58Bf/3HJXzxt0nc+vYo + /nSfRH7Wi4MX09H/exJwUIecJm+ErXVopbzzCXyDsuK0cqYVOsSVOk2WmGWoHVWTACMJWIWpT5px5U4v + /nh/ENe/GsPNb19H05gRt78bx8ffHMRHXw7h6t1+XPq0BWMXk9F3MoYEaFHYIUb4OocpysvOIX8krTit + nGkBjnGl82+VdEtQO6xE53E9Bs8tx+RHVXjnszZ8cNeMP9zfg+tfj2DXGwm4QeQffrmXxnpw+U473rpR + jdG3V6D3RAQJUKNoJwlYP+cvlNeFwDcmK05Lx9PTc7aLu6dzbPETDwo7Bage8UP7eDD2nInC0as5OPdJ + DS591oj37pCQez0YOpdKFdmD9++2473Pm3HhVi2OX9uAA1OxME+Eof7FABR1C0mA/T8p72LKz1r0rwug + 4/JsoDYSsRvno6BLgKpBMZqPqNAzqcfIpeU4db0UZz7ehKlPt+Kdz5uwezIel79ow4XbdTh3swpv3ijD + ofcSsffMMnSMa7CVFlC8SwTDOnvIVXqI/TW+/7sCHl6LogvmPcht9UHFPhHqX5Gh60QQ9p414PCVFEx8 + lItTfy7EuVsV2PlGBImpxuSNIpy8no8jH6Ri8IIRvZMhaHpNgS0HpLQQIcIy7KgCXkvd3NwcZxRAxnbp + AuMGh083tAhQuluI2kN+eOFYAHad1mBgKgwvX0nEsWsZJMSE5le1RF6I8Q8zcfhqEg5cjED/GR06JpRo + eEWOygEJ8lqE0K2ZdY/ysvuY7wVWnFbOtIAnwtfPPWvaIUJRjy+qRyVoPOKPjhNK7HqTKjGlw/C7kXj1 + ajJqR2Q4ei0dL16Oxv4Loeg/q0X3qUC0jCtQe9APpX0CZG/3hTbJ9iLlXUSYeROSsVMwLyTNvnVtzWLk + dXqjclBIH4MfWt4IQNcp2g9n1Og/r8bgRQMKzL/lxeye0qDvXBDMbwbS6lVUfhk2D0tQ0O2LtKpnoXzO + 1kx5H/sYzlU8Nzt+eZELctsEKO73QfWLYjRQFVonmAglzG+psGcqFKaOZ0hIBHaRKPNpFTpOKrDjqBx1 + L0lRRh9ffocQMaYnIdLZpFBedjXzN6IVp5VD6ljPdn3a7enQ9LkPcpulVIWlKN8voL0gQdPrMrRMyNFx + KgA9b2mR1eyFPecNJEqBthMBaD4mx7ZXpKg8IKLVeyOvWYKgVbO/d/FwFcyZM4e14pnvAkOWHcduLX9l + aJk62vunlWWe2NAmRMGupagcIhEvS6gSfmg+TifjpBpr6j3QczoULxyXo+moP09eNSLCxh4fWr0ICUXu + UIQ/+xMdvxq6ZVkFZhYQljGLk8l0jgEq/Q9+ysD6kDTbLzc0SZHd6o3CXm9UHBCg5iUR6kjIDtpoq6td + 0T6h4YlrDol5kUV9PjC1ecPUKIV6JfeVSCZvl8qCf1Ao9E4Sfy3jt+K0ckLSbTmFQmEnCVDPd/F4xtl/ + mW1GxLp52NiuQHbLUuSbl6JsgPrDsAB1h/yRUO6CxsNKVA4LadyXr1QOiS2ieEPGXAhDbPKd3bw8RTKV + s0ajYUeQN0tOK0eXxt+WrEz8rUh4ShVn0x+ZswDFnWrktPgip2MJCVmC5wfEiC5ciM0HZLwwE42bWn1R + QnHG9fMhj+b20Xx3AvvdwBLz5WdmyWnlBKfacuUdMSyGBfMngrBIFW8zYshwQG6THMU7VbRK2hed7JJx + QjHdmqZWET/O3odTXEAsN0rzPAms9/PkmiT6+7NZclo56kSOK2uN5krbolicpQgXsYErCFrNfReb64x1 + 28S00mAYs11R2R3G+2xcs4r7XhTKFVM8Wzkj5+9/U30w91gCBDqOK22J4kpeiORKWvgvkEwES8J+hj3p + 5MotlkZwWwJXcJdpg93VJnEIomdgAve+NJzbusCF86a4pwhM9DT5tmAup1b7eALcF3McJX2EnycxEQys + i7Gz7ERgbZWV+GkC+7HK+jzrdGzVrN3yZX+Y42G+h2bJae3MbJZCGAmrykOwDcvGrTbbr9l/OMH9Gxl0 + JhVMD8wrAAAAAElFTkSuQmCC +</value> + </data> +</root> \ No newline at end of file diff --git a/CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.Designer.cs b/CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.Designer.cs new file mode 100644 index 0000000..77abee6 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.Designer.cs @@ -0,0 +1,470 @@ +锘縩amespace CSFramework.DBTester +{ + partial class frmTestDB + { + /// <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.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.txtResult = new System.Windows.Forms.TextBox(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.button5 = new System.Windows.Forms.Button(); + this.button6 = new System.Windows.Forms.Button(); + this.button7 = new System.Windows.Forms.Button(); + this.button8 = new System.Windows.Forms.Button(); + this.button9 = new System.Windows.Forms.Button(); + this.button10 = new System.Windows.Forms.Button(); + this.button11 = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.button13 = new System.Windows.Forms.Button(); + this.button19 = new System.Windows.Forms.Button(); + this.button18 = new System.Windows.Forms.Button(); + this.button17 = new System.Windows.Forms.Button(); + this.button14 = new System.Windows.Forms.Button(); + this.button12 = new System.Windows.Forms.Button(); + this.txtConn = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.button16 = new System.Windows.Forms.Button(); + this.button15 = new System.Windows.Forms.Button(); + this.btnMSSQL = new System.Windows.Forms.Button(); + this.btnMySql = new System.Windows.Forms.Button(); + this.button20 = new System.Windows.Forms.Button(); + this.button21 = new System.Windows.Forms.Button(); + this.button22 = new System.Windows.Forms.Button(); + this.button23 = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // dataGridView1 + // + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Location = new System.Drawing.Point(15, 504); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.Size = new System.Drawing.Size(543, 165); + this.dataGridView1.TabIndex = 0; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(10, 20); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(103, 41); + this.button1.TabIndex = 1; + this.button1.Text = "IDatabase"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(254, 20); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(222, 41); + this.button2.TabIndex = 1; + this.button2.Text = "DataProviderFactory.GetFactory"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // txtResult + // + this.txtResult.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.txtResult.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtResult.Location = new System.Drawing.Point(564, 265); + this.txtResult.Multiline = true; + this.txtResult.Name = "txtResult"; + this.txtResult.ReadOnly = true; + this.txtResult.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.txtResult.Size = new System.Drawing.Size(332, 404); + this.txtResult.TabIndex = 2; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(119, 20); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(129, 41); + this.button3.TabIndex = 3; + this.button3.Text = "CreateDatabase"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // button4 + // + this.button4.Location = new System.Drawing.Point(10, 65); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(103, 41); + this.button4.TabIndex = 1; + this.button4.Text = "GetTable"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // button5 + // + this.button5.Location = new System.Drawing.Point(119, 65); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(129, 41); + this.button5.TabIndex = 1; + this.button5.Text = "SetTimeOut"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.button5_Click); + // + // button6 + // + this.button6.Location = new System.Drawing.Point(6, 33); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(176, 41); + this.button6.TabIndex = 3; + this.button6.Text = "DbCommandGenerator-鎻愪氦DataTable"; + this.button6.UseVisualStyleBackColor = true; + this.button6.Click += new System.EventHandler(this.button6_Click); + // + // button7 + // + this.button7.Location = new System.Drawing.Point(6, 80); + this.button7.Name = "button7"; + this.button7.Size = new System.Drawing.Size(176, 41); + this.button7.TabIndex = 3; + this.button7.Text = "DbCommandGenerator-鎻愪氦DataSet(浜嬪姟锛�"; + this.button7.UseVisualStyleBackColor = true; + this.button7.Click += new System.EventHandler(this.button7_Click); + // + // button8 + // + this.button8.Location = new System.Drawing.Point(6, 127); + this.button8.Name = "button8"; + this.button8.Size = new System.Drawing.Size(176, 41); + this.button8.TabIndex = 3; + this.button8.Text = "DbFramework.Add"; + this.button8.UseVisualStyleBackColor = true; + this.button8.Click += new System.EventHandler(this.button8_Click); + // + // button9 + // + this.button9.Location = new System.Drawing.Point(207, 33); + this.button9.Name = "button9"; + this.button9.Size = new System.Drawing.Size(166, 41); + this.button9.TabIndex = 3; + this.button9.Text = "DbFramework.Update"; + this.button9.UseVisualStyleBackColor = true; + this.button9.Click += new System.EventHandler(this.button9_Click); + // + // button10 + // + this.button10.Location = new System.Drawing.Point(207, 127); + this.button10.Name = "button10"; + this.button10.Size = new System.Drawing.Size(166, 41); + this.button10.TabIndex = 3; + this.button10.Text = "DbFramework.Delete"; + this.button10.UseVisualStyleBackColor = true; + this.button10.Click += new System.EventHandler(this.button10_Click); + // + // button11 + // + this.button11.Location = new System.Drawing.Point(207, 80); + this.button11.Name = "button11"; + this.button11.Size = new System.Drawing.Size(166, 41); + this.button11.TabIndex = 3; + this.button11.Text = "DbFramework.UpdateList"; + this.button11.UseVisualStyleBackColor = true; + this.button11.Click += new System.EventHandler(this.button11_Click); + this.button11.ChangeUICues += new System.Windows.Forms.UICuesEventHandler(this.button11_ChangeUICues); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.button6); + this.groupBox1.Controls.Add(this.button7); + this.groupBox1.Controls.Add(this.button13); + this.groupBox1.Controls.Add(this.button19); + this.groupBox1.Controls.Add(this.button8); + this.groupBox1.Controls.Add(this.button18); + this.groupBox1.Controls.Add(this.button17); + this.groupBox1.Controls.Add(this.button14); + this.groupBox1.Controls.Add(this.button9); + this.groupBox1.Controls.Add(this.button10); + this.groupBox1.Controls.Add(this.button12); + this.groupBox1.Controls.Add(this.button11); + this.groupBox1.Location = new System.Drawing.Point(14, 233); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(544, 265); + this.groupBox1.TabIndex = 4; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "(MSSQL) DbCommandGenerator/DbFramework娴嬭瘯"; + // + // button13 + // + this.button13.Location = new System.Drawing.Point(6, 218); + this.button13.Name = "button13"; + this.button13.Size = new System.Drawing.Size(176, 41); + this.button13.TabIndex = 3; + this.button13.Text = "DbFramework.AddList\r\n (浜嬪姟锛�"; + this.button13.UseVisualStyleBackColor = true; + this.button13.Click += new System.EventHandler(this.button13_Click); + // + // button19 + // + this.button19.Location = new System.Drawing.Point(6, 171); + this.button19.Name = "button19"; + this.button19.Size = new System.Drawing.Size(176, 41); + this.button19.TabIndex = 3; + this.button19.Text = "DbFramework.Add-Update"; + this.button19.UseVisualStyleBackColor = true; + this.button19.Click += new System.EventHandler(this.button19_Click); + // + // button18 + // + this.button18.Location = new System.Drawing.Point(378, 127); + this.button18.Name = "button18"; + this.button18.Size = new System.Drawing.Size(159, 41); + this.button18.TabIndex = 3; + this.button18.Text = "mysql - 娴嬭瘯Timestamp涓婚敭骞跺彂"; + this.button18.UseVisualStyleBackColor = true; + this.button18.Click += new System.EventHandler(this.button18_Click); + // + // button17 + // + this.button17.Location = new System.Drawing.Point(378, 80); + this.button17.Name = "button17"; + this.button17.Size = new System.Drawing.Size(159, 41); + this.button17.TabIndex = 3; + this.button17.Text = "mysql - DbFramework娴嬭瘯鐗规畩鏁版嵁绫诲瀷"; + this.button17.UseVisualStyleBackColor = true; + this.button17.Click += new System.EventHandler(this.button17_Click); + // + // button14 + // + this.button14.Location = new System.Drawing.Point(379, 33); + this.button14.Name = "button14"; + this.button14.Size = new System.Drawing.Size(159, 41); + this.button14.TabIndex = 3; + this.button14.Text = "DbFramework娴嬭瘯鐗规畩鏁版嵁绫诲瀷"; + this.button14.UseVisualStyleBackColor = true; + this.button14.Click += new System.EventHandler(this.button14_Click); + // + // button12 + // + this.button12.Location = new System.Drawing.Point(207, 174); + this.button12.Name = "button12"; + this.button12.Size = new System.Drawing.Size(166, 41); + this.button12.TabIndex = 3; + this.button12.Text = "DbFramework.DeleteList"; + this.button12.UseVisualStyleBackColor = true; + this.button12.Click += new System.EventHandler(this.button12_Click); + this.button12.ChangeUICues += new System.Windows.Forms.UICuesEventHandler(this.button11_ChangeUICues); + // + // txtConn + // + this.txtConn.Location = new System.Drawing.Point(13, 41); + this.txtConn.Multiline = true; + this.txtConn.Name = "txtConn"; + this.txtConn.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.txtConn.Size = new System.Drawing.Size(862, 50); + this.txtConn.TabIndex = 2; + this.txtConn.Text = "Server=.;Database=CSFrameworkV5_Normal;User ID=sa;Password=test; Max Pool Size=51" + + "2; Pooling=true;Connect Timeout=30"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(13, 15); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(77, 12); + this.label1.TabIndex = 5; + this.label1.Text = "杩炴帴瀛楃涓诧細"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(564, 236); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(65, 12); + this.label2.TabIndex = 5; + this.label2.Text = "鎿嶄綔缁撴灉锛�"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.button1); + this.groupBox2.Controls.Add(this.button23); + this.groupBox2.Controls.Add(this.button4); + this.groupBox2.Controls.Add(this.button16); + this.groupBox2.Controls.Add(this.button15); + this.groupBox2.Controls.Add(this.button5); + this.groupBox2.Controls.Add(this.button2); + this.groupBox2.Controls.Add(this.button3); + this.groupBox2.Location = new System.Drawing.Point(20, 97); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(661, 125); + this.groupBox2.TabIndex = 6; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "IDatabase 娴嬭瘯"; + // + // button16 + // + this.button16.Location = new System.Drawing.Point(389, 65); + this.button16.Name = "button16"; + this.button16.Size = new System.Drawing.Size(129, 41); + this.button16.TabIndex = 1; + this.button16.Text = "娴嬭瘯MySQLDateTime"; + this.button16.UseVisualStyleBackColor = true; + this.button16.Click += new System.EventHandler(this.button16_Click); + // + // button15 + // + this.button15.Location = new System.Drawing.Point(254, 65); + this.button15.Name = "button15"; + this.button15.Size = new System.Drawing.Size(129, 41); + this.button15.TabIndex = 1; + this.button15.Text = "娴嬭瘯MySQLDateTime"; + this.button15.UseVisualStyleBackColor = true; + this.button15.Click += new System.EventHandler(this.button15_Click); + // + // btnMSSQL + // + this.btnMSSQL.Location = new System.Drawing.Point(114, 6); + this.btnMSSQL.Name = "btnMSSQL"; + this.btnMSSQL.Size = new System.Drawing.Size(63, 31); + this.btnMSSQL.TabIndex = 7; + this.btnMSSQL.Text = "MSSQL"; + this.btnMSSQL.UseVisualStyleBackColor = true; + this.btnMSSQL.Click += new System.EventHandler(this.btnMSSQL_Click); + // + // btnMySql + // + this.btnMySql.Location = new System.Drawing.Point(183, 6); + this.btnMySql.Name = "btnMySql"; + this.btnMySql.Size = new System.Drawing.Size(63, 31); + this.btnMySql.TabIndex = 7; + this.btnMySql.Text = "MySql"; + this.btnMySql.UseVisualStyleBackColor = true; + this.btnMySql.Click += new System.EventHandler(this.btnMySql_Click); + // + // button20 + // + this.button20.Location = new System.Drawing.Point(687, 97); + this.button20.Name = "button20"; + this.button20.Size = new System.Drawing.Size(172, 41); + this.button20.TabIndex = 3; + this.button20.Text = "meta_GetTableNamesList"; + this.button20.UseVisualStyleBackColor = true; + this.button20.Click += new System.EventHandler(this.button20_Click); + // + // button21 + // + this.button21.Location = new System.Drawing.Point(687, 144); + this.button21.Name = "button21"; + this.button21.Size = new System.Drawing.Size(172, 41); + this.button21.TabIndex = 3; + this.button21.Text = "meta_GetDatabaseList"; + this.button21.UseVisualStyleBackColor = true; + this.button21.Click += new System.EventHandler(this.button21_Click); + // + // button22 + // + this.button22.Location = new System.Drawing.Point(687, 191); + this.button22.Name = "button22"; + this.button22.Size = new System.Drawing.Size(172, 41); + this.button22.TabIndex = 3; + this.button22.Text = "meta_GetTableStruList"; + this.button22.UseVisualStyleBackColor = true; + this.button22.Click += new System.EventHandler(this.button22_Click); + // + // button23 + // + this.button23.Location = new System.Drawing.Point(482, 20); + this.button23.Name = "button23"; + this.button23.Size = new System.Drawing.Size(103, 41); + this.button23.TabIndex = 1; + this.button23.Text = "GetTop"; + this.button23.UseVisualStyleBackColor = true; + this.button23.Click += new System.EventHandler(this.button23_Click); + // + // frmTestDB + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(904, 681); + this.Controls.Add(this.btnMySql); + this.Controls.Add(this.btnMSSQL); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.txtConn); + this.Controls.Add(this.txtResult); + this.Controls.Add(this.button22); + this.Controls.Add(this.button21); + this.Controls.Add(this.button20); + this.Controls.Add(this.dataGridView1); + this.Name = "frmTestDB"; + this.Text = "CSFramework.DB娴嬭瘯绋嬪簭"; + this.Load += new System.EventHandler(this.frmTestDB_Load); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.DataGridView dataGridView1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.TextBox txtResult; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button button6; + private System.Windows.Forms.Button button7; + private System.Windows.Forms.Button button8; + private System.Windows.Forms.Button button9; + private System.Windows.Forms.Button button10; + private System.Windows.Forms.Button button11; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button button12; + private System.Windows.Forms.Button button13; + private System.Windows.Forms.TextBox txtConn; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Button button14; + private System.Windows.Forms.Button button15; + private System.Windows.Forms.Button button16; + private System.Windows.Forms.Button button17; + private System.Windows.Forms.Button button18; + private System.Windows.Forms.Button btnMSSQL; + private System.Windows.Forms.Button btnMySql; + private System.Windows.Forms.Button button19; + private System.Windows.Forms.Button button20; + private System.Windows.Forms.Button button21; + private System.Windows.Forms.Button button22; + private System.Windows.Forms.Button button23; + } +} \ No newline at end of file diff --git a/CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.cs b/CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.cs new file mode 100644 index 0000000..a422e51 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.cs @@ -0,0 +1,737 @@ +锘縰sing CSFramework.DB; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.Common; +using System.Threading; +using System.Windows.Forms; + +namespace CSFramework.DBTester +{ + public partial class frmTestDB : Form + { + //string _Conn = "Server=.;Database=CSFramework_WebAPI_Log;User ID=sa;Password=test; Max Pool Size=512; Pooling=true;Connect Timeout=30"; + + DatabaseType _DatabaseType = DatabaseType.SqlServer; + + public frmTestDB() + { + InitializeComponent(); + } + + private void frmTestDB_Load(object sender, EventArgs e) + { + ShowResult("榛樿涓篠QLServer杩炴帴"); + btnMSSQL_Click(btnMSSQL, null); + } + + private void btnMSSQL_Click(object sender, EventArgs e) + { + _DatabaseType = DatabaseType.SqlServer; + txtConn.Text = "Server=.;Database=CSFrameworkV5_Normal;User ID=sa;Password=test; Max Pool Size=512; Pooling=true;Connect Timeout=30"; + ShowResult("璁剧疆涓篠QLServer杩炴帴"); + } + + private void btnMySql_Click(object sender, EventArgs e) + { + _DatabaseType = DatabaseType.MySQL; + txtConn.Text = "Server=120.79.85.97;Port=3306;Database=cs5_normal;User ID=root;Password=xxxxxxxx;Connection TimeOut=30;Charset=utf8;Pooling=true;Min Pool Size=0;Max Pool Size=500;Connection Lifetime=0;Convert Zero Datetime=True;"; + ShowResult("璁剧疆涓篗ySQL杩炴帴"); + MessageBox.Show("璇蜂慨鏀筩onnstring鐨勫瘑鐮�"); + txtConn.Focus(); + } + + public class UserModel + { + public string Account { get; set; } + public string Password { get; set; } + } + + private IDatabase _DB + { + get + { + return DatabaseFactory.CreateMDB(DatabaseType.SqlServer, txtConn.Text); + } + } + + + private void button1_Click(object sender, EventArgs e) + { + + string s = _DB.ConnectionString; + ShowResult(s); + + DbCommand o2 = _DB.CreateCommand("SELECT GETDATE()", System.Data.CommandType.Text); + object o9 = _DB.ExecuteCommand(o2); + ShowResult(o9); + + DbCommand c1 = _DB.CreateCommand("SELECT * FROM sys_Log", System.Data.CommandType.Text); + object o20 = _DB.GetDataSet(c1); + ShowResult(o20); + + object o3 = _DB.CreateCommandBuilder(); + ShowResult(o3); + + object o4 = _DB.CreateConnection(txtConn.Text); + ShowResult(o4); + (o4 as IDisposable).Dispose(); + + + object o5 = _DB.CreateDataAdapter(); + ShowResult(o5); + + object o6 = _DB.CreateParameter("@asd", "asdf"); + ShowResult(o6); + + object o8 = _DB.DateTimeType; + ShowResult(o8); + + object o10 = _DB.ExecuteReader("SELECT * FROM sys_Log"); + ShowResult(o10); + + object o11 = _DB.ExecuteScalar("SELECT * FROM sys_Log"); + ShowResult(o11); + + object o12 = _DB.ExecuteSQL("SELECT * FROM sys_Log"); + ShowResult(o12); + + DbTransaction tran = _DB.TransBegin(); + object o13 = _DB.ExecuteTrans(tran, "SELECT * FROM sys_Log"); + ShowResult(o13); + _DB.TransRollback(tran); + + object o14 = _DB.GetDataRow("SELECT TOP 1 * FROM sys_Log"); + ShowResult(o14); + + object o15 = _DB.GetDataSet("SELECT TOP 1 * FROM sys_Log"); + ShowResult(o15); + + object o16 = _DB.GetTable("SELECT TOP 1 * FROM sys_Log"); + ShowResult(o16); + + object o17 = _DB.ParamSymboName; + ShowResult(o17); + + object o18 = _DB.GetServerTime(); + ShowResult(o18); + + DbParameter p = _DB.CreateParameter("@TableName", "sys_Log"); + object o19 = _DB.GetDataSet("sp_sys_GetTableFieldDef", System.Data.CommandType.StoredProcedure, new System.Data.IDataParameter[] { p }); + ShowResult(o19); + } + + private void ShowResult(object o) + { + if (o != null) + txtResult.Text = txtResult.Text + "\r\n" + o.ToString(); + else + txtResult.Text = txtResult.Text + "\r\n瀵硅薄=null"; + + txtResult.SelectionStart = txtResult.Text.Length; + txtResult.ScrollToCaret(); + } + + private void button2_Click(object sender, EventArgs e) + { + DbProviderFactory factory1 = DataProviderFactory.GetFactory(DatabaseType.SqlServer); + ShowResult(factory1); + + DbProviderFactory factory2 = DataProviderFactory.GetFactory(DatabaseType.MySQL); + ShowResult(factory2); + + DbProviderFactory factory3 = DataProviderFactory.GetFactory(DatabaseType.Oracle); + ShowResult(factory3); + } + + private void button3_Click(object sender, EventArgs e) + { + string _Conn = txtConn.Text; + + IDatabase db1 = DatabaseFactory.CreateMDB(_DatabaseType, _Conn); + ShowResult(db1); + ShowResult(db1.GetServerTime()); + + //IDatabase db2 = DatabaseFactory.CreateMDB(_DatabaseType, _Conn); + //ShowResult(db2); + //ShowResult(db2.GetServerTime()); + + //IDatabase db3 = DatabaseFactory.CreateMDB(DatabaseType.Oracle, _Conn); + //ShowResult(db3); + //ShowResult(db3.GetServerTime()); + + //IDatabase db4 = DatabaseFactory.CreateDatabase(_DatabaseType, _Conn); + //ShowResult(db4); + //ShowResult(db4.GetServerTime()); + + //IDatabase db5 = DatabaseFactory.CreateDatabase(DatabaseType.Oracle, _Conn); + //ShowResult(db5); + //ShowResult(db5.GetServerTime()); + + IDatabase db6 = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, _Conn); + ShowResult(db6); + ShowResult(db6.GetServerTime()); + + } + + private void button4_Click(object sender, EventArgs e) + { + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, txtConn.Text); + DataTable dt = db.GetTable("SELECT TOP 10 * FROM dbo.sys_Log", "sys_Log"); + dataGridView1.AutoGenerateColumns = true; + dataGridView1.DataSource = dt; + } + + private void button5_Click(object sender, EventArgs e) + { + DatabaseFactory.CommandTimeOut = 60 * 5; //璁剧疆DbCommand鍛戒护瓒呮椂锛�5鍒嗛挓 + DatabaseFactory.ConnectionTimeOut = 35;//璁剧疆鏁版嵁搴撹繛鎺ヨ秴鏃讹細35绉掗挓 + + //杩炴帴瀛楃涓叉寚瀹氳繛鎺ヨ秴鏃讹紝25绉� + string connectionString = "Server=.;Database=CSFramework_WebAPI;User ID=sa;Password=test;Connection Timeout=25;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, connectionString); + DbConnection conn = db.CreateConnection();//35s + int a = conn.ConnectionTimeout; + ShowResult(a); + + //杩炴帴瀛楃涓叉病鏈夋寚瀹氳繛鎺ヨ秴鏃讹紝鑷姩娣诲姞Connection Timeout灞炴�� + string connectionString1 = "Server=.;Database=CSFramework_WebAPI;User ID=sa;Password=test;"; + IDatabase db1 = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, connectionString1); + DbConnection conn1 = db1.CreateConnection(); + int a1 = conn1.ConnectionTimeout;//35s + ShowResult(a1); + + //Console.Write(a1); + //Console.Write(conn1.ConnectionString); + + //娴嬭瘯鍛戒护瓒呮椂 + DbCommand cmd = db.CreateCommand("SELECT COUNT(*) FROM Api_User", CommandType.Text); + cmd.Connection = conn; + int i = cmd.CommandTimeout; + object o = cmd.ExecuteScalar(); + ShowResult(o); + Console.Write(a);//300s + + conn.Dispose(); + conn1.Dispose(); + } + + private void button6_Click(object sender, EventArgs e) + { + // + //娴嬭瘯妗堜緥锛氭彁浜ataTable锛屾壒閲忎慨鏀规彁浜ゅ鏉¤褰� + // + string conn = "Data Source=127.0.0.1;Initial Catalog=CSFramework_License;User ID=sa;Password =test;Persist Security Info=True;Connect Timeout=15;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, conn); + + var dt = db.GetTable("SELECT TOP 10 * FROM dbo.sys_RegisterLog"); + dt.Rows[0]["HID"] = "淇敼HID";//淇敼涓�鏉¤褰� + dt.Rows[1].Delete();//鍒犻櫎涓�鏉¤褰� + + var row = dt.Rows.Add();//鏂板涓�鏉¤褰� + row["LicenseID"] = "xxxx"; + row["RegisterNo"] = "xxxx"; + row["RegisterTime"] = DateTime.Now; + row["LogConent"] = "xxxx"; + row["HID"] = "xxxx"; + + //鏍规嵁Model鎻愪氦鏁版嵁 + int i = new DbFramework(db).Update(dt, typeof(sys_RegisterLog), new string[] { "isid" }, new string[] { "isid" }); + + ShowResult($"鍏辨洿鏂拌褰曟暟锛歿i}"); + } + + private void button7_Click(object sender, EventArgs e) + { + // + //娴嬭瘯妗堜緥锛氭彁浜ataSet锛屾壒閲忎慨鏀广�佹彁浜ゅ琛ㄥ鏉¤褰� + // + string conn = "Data Source=127.0.0.1;Initial Catalog=CSFramework_License;User ID=sa;Password =test;Persist Security Info=True;Connect Timeout=15;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, conn); + + //琛�1 + var dt = db.GetTable("SELECT TOP 10 * FROM dbo.sys_RegisterLog ORDER BY isid ASC", "sys_RegisterLog"); + dt.Rows[0]["HID"] = "淇敼HID";//淇敼涓�鏉¤褰� + dt.Rows[1].Delete();//鍒犻櫎涓�鏉¤褰� + + var row = dt.Rows.Add();//鏂板涓�鏉¤褰� + row["LicenseID"] = "xxxx"; + row["RegisterNo"] = "xxxx"; + row["RegisterTime"] = DateTime.Now; + row["LogConent"] = "xxxx"; + row["HID"] = "xxxx"; + + var row2 = dt.Rows.Add();//鏂板涓�鏉¤褰� + row2["LicenseID"] = "xxxx22"; + row2["RegisterNo"] = "xxxx22"; + row2["RegisterTime"] = DateTime.Now; + row2["LogConent"] = "xxxx22"; + row2["HID"] = "xxxx22"; + + //琛�2 + var dt1 = db.GetTable("SELECT TOP 10 * FROM dbo.sys_AdminUser ORDER BY isid DESC", "sys_AdminUser"); + var row1 = dt1.Rows[0]; + row1["AccountName"] = row1["AccountName"].ToString() + "-1"; + row1["LastLoginTime"] = DateTime.Now;//淇敼鏁版嵁 + + // + //閲嶈锛侊紒锛� 鏋勫缓ORM瀵硅薄妯″瀷涓庤〃缁撴瀯鐨勫叧绯� + //sys_RegisterLog琛ㄦā鍨嬪叧绯� + //sys_AdminUser琛ㄦā鍨嬪叧绯� + List<DbDataUpdateORM> orms = new List<DbDataUpdateORM>(); + orms.Add(new DbDataUpdateORM(typeof(sys_RegisterLog), new string[] { "isid" }, new string[] { "isid" })); + orms.Add(new DbDataUpdateORM(typeof(sys_AdminUser), new string[] { "Account" }, new string[] { "isid" })); + + //缁勫悎DataSet, 涓�娆℃�ф彁浜ゅ寮犺〃 + DataSet ds = new DataSet(); + ds.Tables.Add(dt.GetChanges()); + ds.Tables.Add(dt1.GetChanges()); + + //鎻愪氦鏁版嵁 + int i = 0; + DbTransaction tran = db.TransBegin(); + DbFramework updater = new DbFramework(db, tran); + try + { + i = updater.Update(ds, orms);//鎻愪氦鏁版嵁 + + tran.Commit(); + } + catch (Exception ex) + { + tran.Rollback(); + ShowResult(ex.Message); + } + + ShowResult($"鍏辨洿鏂拌褰曟暟锛歿i}"); + } + + private void button8_Click(object sender, EventArgs e) + { + // + //娴嬭瘯妗堜緥锛氭柊澧炰竴涓璞★紝鏍规嵁瀵硅薄ORM鑷姩瀛樺偍鍒版暟鎹簱 + // + string conn = "Data Source=127.0.0.1;Initial Catalog=CSFramework_License;User ID=sa;Password =test;Persist Security Info=True;Connect Timeout=15;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, conn); + + sys_AdminUser user0 = new sys_AdminUser + { + Account = "Test-" + DateTime.Now.ToString("yyMMddHHmmss"), + AccountName = "test", + AccountType = "xx", + Password = "pwd", + LoginCount = 1929, + Amount = decimal.Parse("1231.22"), + }; + + //鏂板涓�涓璞� + bool b = new DbFramework(db).AddObject(user0, new string[] { "isid" }); + ShowResult($"鏇存柊{b}"); + + } + + private void button9_Click(object sender, EventArgs e) + { + // + //娴嬭瘯妗堜緥锛氫慨鏀瑰璞★紝鏍规嵁瀵硅薄ORM鑷姩瀛樺偍鍒版暟鎹簱 + // + string conn = "Data Source=127.0.0.1;Initial Catalog=CSFramework_License;User ID=sa;Password =test;Persist Security Info=True;Connect Timeout=15;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, conn); + + sys_RegisterLog log = db.ExecuteReader<sys_RegisterLog>("SELECT * FROM dbo.sys_RegisterLog where isid=133"); + log.HID = "xxxxxxxxxxxxxxxxxxxx"; + log.LicenseID = "asdfasdfasf"; + log.LogConent = "asfdasdfasdfasdfasdf"; + log.RegisterNo = "xxxxxxxxxxxxxxxxx"; + log.RegisterTime = DateTime.Now; + + //淇敼瀵硅薄 + bool ok = new DbFramework(db).UpdateObject(log, new string[] { "isid" }, new string[] { "isid" }); + ShowResult($"鎿嶄綔{ok}"); + } + + private void button10_Click(object sender, EventArgs e) + { + // + //娴嬭瘯妗堜緥锛氬垹闄や竴涓璞★紝鏍规嵁瀵硅薄ORM鑷姩鑷姩鍒犻櫎璁板綍 + // + + string conn = "Data Source=127.0.0.1;Initial Catalog=CSFramework_License;User ID=sa;Password =test;Persist Security Info=True;Connect Timeout=15;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, conn); + + var isid = db.ExecuteScalar("SELECT TOP 1 ISID FROM sys_RegisterLog"); + + sys_RegisterLog log = new sys_RegisterLog(); + log.isid = int.Parse(isid.ToString()); + + //鍒犻櫎涓�涓璞� + bool ok = new DbFramework(db).DeleteObject(log, new string[] { "isid" }); + ShowResult($"鎿嶄綔{ok}"); + } + + private void button11_ChangeUICues(object sender, UICuesEventArgs e) + { + + } + + private void button11_Click(object sender, EventArgs e) + { + // + //娴嬭瘯妗堜緥锛氫慨鏀瑰璞″垪琛紝鏍规嵁瀵硅薄ORM鑷姩瀛樺偍鍒版暟鎹簱 + // + + string conn = "Data Source=127.0.0.1;Initial Catalog=CSFramework_License;User ID=sa;Password =test;Persist Security Info=True;Connect Timeout=15;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, conn); + + sys_AdminUser user = new sys_AdminUser + { + Account = "000011", + AccountName = "test11", + AccountType = "xx111111111111111111", + Password = "pwd11111111" + }; + + sys_AdminUser user2 = new sys_AdminUser + { + Account = "000022", + AccountName = "test22222222222", + AccountType = "xx222222222222222222", + Password = "pwd222222222" + }; + + List<sys_AdminUser> list = new List<sys_AdminUser>(); + list.Add(user); + list.Add(user2); + + //淇敼瀵硅薄鍒楄〃 + int i = new DbFramework(db).UpdateList<sys_AdminUser>(list, new string[] { "Account" }, new string[] { "isid" }); + ShowResult($"鎵归噺鏇存柊璁板綍{i}"); + + } + + private void button12_Click(object sender, EventArgs e) + { + // + //娴嬭瘯妗堜緥锛氬垹闄ゅ璞″垪琛紝鏍规嵁瀵硅薄ORM鑷姩鍒犻櫎璁板綍 + // + string conn = "Data Source=127.0.0.1;Initial Catalog=CSFramework_License;User ID=sa;Password =test;Persist Security Info=True;Connect Timeout=15;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, conn); + + var isid = db.GetStringList("SELECT TOP 2 ISID FROM sys_RegisterLog"); + + sys_RegisterLog R1 = new sys_RegisterLog + { + isid = int.Parse(isid[0]), + }; + + sys_RegisterLog R2 = new sys_RegisterLog + { + isid = int.Parse(isid[1]), + }; + + List<sys_RegisterLog> list = new List<sys_RegisterLog>(); + list.Add(R1); + list.Add(R2); + + //鍒犻櫎涓�涓璞″垪琛� + int i = new DbFramework(db).DeleteList<sys_RegisterLog>(list, new string[] { "isid" }); + ShowResult($"鎵归噺鍒犻櫎璁板綍{i}"); + } + + private void button13_Click(object sender, EventArgs e) + { + // + //娴嬭瘯妗堜緥锛氭柊澧炲璞″垪琛紝鏍规嵁瀵硅薄ORM鑷姩瀛樺偍鍒版暟鎹簱 + // + string conn = "Data Source=127.0.0.1;Initial Catalog=CSFramework_License;User ID=sa;Password =test;Persist Security Info=True;Connect Timeout=15;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, conn); + + sys_AdminUser user = new sys_AdminUser + { + Account = "Test-" + DateTime.Now.ToString("yyMMddHHmmssfff"), + AccountName = "test", + AccountType = "xx", + Password = "pwd" + }; + + Thread.Sleep(50); + + sys_AdminUser user2 = new sys_AdminUser + { + Account = "Test-" + DateTime.Now.ToString("yyMMddHHmmssfff"), + AccountName = "test2", + AccountType = "xx", + Password = "pwd" + }; + + List<sys_AdminUser> list = new List<sys_AdminUser>(); + list.Add(user); + list.Add(user2); + + //鎻愪氦鏁版嵁 + int i = 0; + DbTransaction tran = db.TransBegin(); + DbFramework updater = new DbFramework(db, tran); + try + { + i = updater.AddList<sys_AdminUser>(list, new string[] { "isid" }); + + tran.Commit(); + } + catch (Exception ex) + { + tran.Rollback(); + ShowResult(ex.Message); + } + + ShowResult($"鍏辨洿鏂拌褰曟暟锛歿i}"); + } + + private void button14_Click(object sender, EventArgs e) + { + string conn = "Data Source=127.0.0.1;Initial Catalog=CSFrameworkV5_Normal;User ID=sa;Password =test;Persist Security Info=True;Connect Timeout=15;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, conn); + + var dt = db.GetTable("select TOP 1 * from _TestDataUpdate"); + + ShowResult($"鏌ヨ鎴愬姛,璁板綍{dt.Rows.Count}"); + + DbFramework update = new DbFramework(db); + + _TestDataUpdate m = new _TestDataUpdate + { + _Binary = new byte[] { 1, 2, 3, 4, 5, 56 }, + _Bit = true, + _Char = 'A', + _Int = 100000, + _Datetime2 = DateTime.Now, + _DateTimeOffset = new DateTimeOffset(DateTime.Now), + _Timestamp = new DateTime(), + _Image = new byte[] { 1, 2, 3, 4, 5, 56 }, + _Ntext = "_Ntext_Ntext_Ntext_Ntext_Ntext", + _Sql_variant = "_Sql_variant",//鍙彉鏁版嵁绫诲瀷 + _UniqueIdentifier = Guid.NewGuid(), + _Varbinary = new byte[] { 1, 2, 3, 4, 5, 56 }, + + //鏍囧噯XML鏍煎紡 + _Xml = "<?xml version=\"1.0\"?><configuration><startup><supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\"/></startup></configuration>", + + //SQL SERVER 2008鏀寔涓ょ绌洪棿鏁版嵁绫诲瀷锛実eometry鍜実eography.鍏朵腑geometry鏁版嵁绫诲瀷鏀寔骞抽潰鎴栧钩闈㈢悆鏁版嵁, + //geography鍙敤浜庡瓨鍌℅PS缁忓害鍜岀含搴﹀潗鏍囩瓑妞悆浣撴暟鎹�� + //geometry鍜実eography鏁版嵁绫诲瀷鍩轰簬geometry灞傛缁撴瀯銆� + _Geography = "POINT(55.9271035250276 -3.29431266523898)", //Geography 绫诲瀷鏁版嵁缁撴瀯 + _Geometry = "POINT(55.9271035250276 -3.29431266523898)", //Geometry 绫诲瀷鏁版嵁缁撴瀯 + + //鎽樿:hierarchyid 鏁版嵁绫诲瀷锛屾槸sqlserver 2008涓柊澧炵殑涓�涓狢LR鏁版嵁绫诲瀷锛屾鏁版嵁绫诲瀷搴旂敤浜庡瓨鍌ㄥ叿鏈夊眰绾х殑缁撴瀯鍥� + _Hierarchyid = "/1/2/2/1/5/3/4/", + }; + + int isid = 0; + + bool ok1 = update.AddObject<_TestDataUpdate>(m, new string[] { "isid", "_Timestamp" }, out isid); + ShowResult($"鏂板瀵硅薄缁撴灉{ok1}"); + + var o = update.Select<_TestDataUpdate>("isid", isid); + ShowResult($"鏌ヨ瀵硅薄缁撴灉{o._UniqueIdentifier}"); + + m.isid = 12; + bool ok2 = update.UpdateObject<_TestDataUpdate>(m, new string[] { "isid", }, new string[] { "isid", "_Timestamp" }); + ShowResult($"淇敼瀵硅薄缁撴灉{ok2}"); + + m.isid = 2; + bool ok3 = update.DeleteObject<_TestDataUpdate>(m, new string[] { "isid", }); + ShowResult($"鍒犻櫎瀵硅薄缁撴灉{ok3}"); + + } + + private void button15_Click(object sender, EventArgs e) + { + //瑙e喅鏂规锛� + //杩炴帴瀛楃涓插垹闄わ細Allow Zero Datetime=True; 鍔犱笂锛欳onvert Zero Datetime=True; + string conn = "Server={0};Port={1};Database={2};User ID={3};Password={4};Connection TimeOut={5};Charset=utf8;Pooling=true;Min Pool Size=0;Max Pool Size=500;Connection Lifetime=0;Convert Zero Datetime=True;"; + conn = txtConn.Text; + + IDatabase db = DatabaseFactory.CreateMySqlDatabase(conn); + + var DT = db.GetTable("SELECT * FROM tb_MyUserRoles LIMIT 10;"); + var row = DT.Rows.Add(); + row["CreateTime"] = DateTime.Now; + DT.AcceptChanges(); + + MessageBox.Show(row["CreateTime"].ToString()); + + } + + private void button16_Click(object sender, EventArgs e) + { + IDatabase db = DatabaseFactory.CreateMySqlDatabase(txtConn.Text); + + CommandHelper sp = db.CreateSqlProc("usp_SearchCustomer"); + sp.AddParam("CustomerFrom", ""); + sp.AddParam("CustomerTo", ""); + sp.AddParam("CustomerName", ""); + sp.AddParam("Attribute", ""); + + var DT = db.GetTable(sp.Command, "tb_Customer"); + } + + private void button17_Click(object sender, EventArgs e) + { + IDatabase db = DatabaseFactory.CreateMySqlDatabase(txtConn.Text); + + _testdataupdate m = new _testdataupdate + { + _BinaryCHAR = new byte[] { 1, 2, 3, 4, 5, 56 }, + _Bit = true, + _Char = 'A', + _Int = 100000, + _Datetime = DateTime.Now, + _Timestamp = new DateTime(), + _Image = new byte[] { 1, 2, 3, 4, 5, 56 }, + _Ntext = "_Ntext_Ntext_Ntext_Ntext_Ntext", + _Sql_variant = "_Sql_variant",//鍙彉鏁版嵁绫诲瀷 + _UniqueIdentifier = Guid.NewGuid().ToString(), + _Varbinary = new byte[] { 1, 2, 3, 4, 5, 56 }, + + //鏍囧噯XML鏍煎紡 + _Json = "{}", + + //SQL SERVER 2008鏀寔涓ょ绌洪棿鏁版嵁绫诲瀷锛実eometry鍜実eography.鍏朵腑geometry鏁版嵁绫诲瀷鏀寔骞抽潰鎴栧钩闈㈢悆鏁版嵁, + //geography鍙敤浜庡瓨鍌℅PS缁忓害鍜岀含搴﹀潗鏍囩瓑妞悆浣撴暟鎹�� + //geometry鍜実eography鏁版嵁绫诲瀷鍩轰簬geometry灞傛缁撴瀯銆� + _Geography = "POINT(55.9271035250276 -3.29431266523898)", //Geography 绫诲瀷鏁版嵁缁撴瀯 + _Geometry = "POINT(55.9271035250276 -3.29431266523898)", //Geometry 绫诲瀷鏁版嵁缁撴瀯 + + //鎽樿:hierarchyid 鏁版嵁绫诲瀷锛屾槸sqlserver 2008涓柊澧炵殑涓�涓狢LR鏁版嵁绫诲瀷锛屾鏁版嵁绫诲瀷搴旂敤浜庡瓨鍌ㄥ叿鏈夊眰绾х殑缁撴瀯鍥� + _Hierarchyid = "/1/2/2/1/5/3/4/", + }; + + DbFramework update = new DbFramework(db); + + bool ok1 = update.AddObject<_testdataupdate>(m, new string[] { "isid", "_Timestamp" }); + ShowResult($"鏂板瀵硅薄缁撴灉{ok1}"); + + m.isid = 12; + bool ok2 = update.UpdateObject<_testdataupdate>(m, new string[] { "isid", }, new string[] { "isid", "_Timestamp" }); + ShowResult($"淇敼瀵硅薄缁撴灉{ok2}"); + + m.isid = 2; + bool ok3 = update.DeleteObject<_testdataupdate>(m, new string[] { "isid", }); + ShowResult($"鍒犻櫎瀵硅薄缁撴灉{ok3}"); + } + + private void button18_Click(object sender, EventArgs e) + { + IDatabase db = DatabaseFactory.CreateMySqlDatabase(txtConn.Text); + + //鏌ヨ鍘熸暟鎹� + _testdataupdate o = db.ExecuteReader<_testdataupdate>("SELECT * FROM _testdataupdate WHERE isid=1;"); + _testdataupdate m = new _testdataupdate();//鐢ㄤ簬淇敼璧勬枡鐨勫璞� + + //鑾峰彇timestamp鐨勫�� + DateTime ts = o._Timestamp; + ShowResult($"timestamp鍊�:{ts}"); + + //CSFramework.DB缁勪欢 + CSFramework.DB.DbFramework update = new DbFramework(db); + + //娴嬭瘯姝ラ1锛氭ā鎷熷叾浠栫敤鎴蜂慨鏀硅褰� + m.isid = 1; //isid浣滀负涓婚敭鏇存柊璁板綍 + m._Ntext = "妯℃嫙鍏朵粬鐢ㄦ埛淇敼璁板綍-isid浣滀负涓婚敭鏇存柊璁板綍" + Guid.NewGuid().ToString(); + bool ok1 = update.UpdateObject<_testdataupdate>(m, new string[] { "isid", }, new string[] { "isid", "_Timestamp" }); + ShowResult($"淇敼瀵硅薄缁撴灉:{ok1}"); + + //鏌ヨ淇敼鍚嶵imestamp鐨勫�� + _testdataupdate o1 = db.ExecuteReader<_testdataupdate>("SELECT * FROM _testdataupdate WHERE isid=1;"); + ShowResult($"timestamp鍊硷紙淇敼鍚庯級:{o1._Timestamp}"); + + //娴嬭瘯姝ラ2锛歍imestamp绫诲瀷鐨勫瓧娈典綔涓轰富閿洿鏂版暟鎹� + m._Timestamp = o._Timestamp; + m._Ntext = "Timestamp绫诲瀷鐨勫瓧娈典綔涓轰富閿洿鏂版暟鎹�"; + bool ok2 = update.UpdateObject<_testdataupdate>(m, new string[] { "_Timestamp", }, new string[] { "isid", "_Timestamp" }); + if (ok2) + ShowResult($"淇敼瀵硅薄缁撴灉:{ok2}"); + else + ShowResult($"鍘熻褰曞凡琚慨鏀癸紙骞跺彂鎿嶄綔锛夛紒"); + + + } + + private void button19_Click(object sender, EventArgs e) + { + // + //娴嬭瘯妗堜緥锛氫慨鏀瑰璞★紝鏍规嵁瀵硅薄ORM鑷姩瀛樺偍鍒版暟鎹簱 + // + string conn = "Data Source=127.0.0.1;Initial Catalog=CSFramework_License;User ID=sa;Password =test;Persist Security Info=True;Connect Timeout=15;"; + IDatabase db = DatabaseFactory.CreateDatabase(DatabaseType.SqlServer, conn); + + //浠庢暟鎹簱鑾峰彇瀵硅薄,鏈�鏂版暟鎹� + sys_AdminUser user = db.ExecuteReader<sys_AdminUser>("SELECT * FROM sys_AdminUser where isid=49"); + user.AccountName = "淇敼鐢ㄦ埛鍚嶇О"; + user.LoginCount = 111999; + user.Amount = decimal.Parse("111999.99"); + + string[] PKFields = new string[] { "isid" };//涓婚敭瀛楁 + string[] ignoreFields = new string[] { "isid", "Account" };//蹇界暐鐨勫瓧娈靛垪琛紝姣斿鑷瀛楁銆佹椂闂存埑绛夈�� + string[] updateFields = new string[] { "AccountName", "Amount" };//鎸囧畾鎻愪氦鏁版嵁鐨勫瓧娈�(ignoreFields鍙傛暟鍙互涓嶄紶鍊�) + + //鎸囧畾蹇界暐鏇存柊鐨勫瓧娈� + bool ok1 = new DbFramework(db).UpdateObject(user, PKFields, ignoreFields); + //UPDATE SYS_ADMINUSER SET AccountType=@AccountType,AccountName=@AccountName,Password=@Password,FlagLock=@FlagLock,LastLoginTime=@LastLoginTime,LoginCount=@LoginCount,Amount=@Amount WHERE isid=@isid + + //鎸囧畾鏇存柊鐨勫瓧娈� + bool ok2 = new DbFramework(db).UpdateObject(user, PKFields, null, updateFields); + //UPDATE SYS_ADMINUSER SET AccountName=@AccountName,Amount=@Amount WHERE isid=@isid + + //鎸囧畾蹇界暐鏇存柊+鏇存柊鐨勫瓧娈碉紝姝ゆ柟妗坕gnoreFields鍙傛暟鏃犳晥锛堢▼搴忎笉澶勭悊锛� + bool ok3 = new DbFramework(db).UpdateObject(user, PKFields, ignoreFields, updateFields); + //UPDATE SYS_ADMINUSER SET AccountName=@AccountName,Amount=@Amount WHERE isid=@isid + } + + private void button20_Click(object sender, EventArgs e) + { + IDatabase db = DatabaseFactory.CreateDatabase(_DatabaseType, txtConn.Text); + var list = db.meta_GetTableNamesList(); + ShowResult($"list={list.Count}"); + foreach (var o in list) ShowResult(o.name); + } + + private void button21_Click(object sender, EventArgs e) + { + IDatabase db = DatabaseFactory.CreateDatabase(_DatabaseType, txtConn.Text); + var list = db.meta_GetDatabaseList(); + ShowResult($"list={list.Count}"); + foreach (var o in list) ShowResult(o.DBName); + } + + private void button22_Click(object sender, EventArgs e) + { + IDatabase db = DatabaseFactory.CreateDatabase(_DatabaseType, txtConn.Text); + var list = db.meta_GetTableStruList("sys_Log"); + ShowResult($"list={list.Count}"); + foreach (var o in list) ShowResult(o.FieldName); + } + + private void button23_Click(object sender, EventArgs e) + { + IDatabase db = DatabaseFactory.CreateDatabase(_DatabaseType, txtConn.Text); + + //娴嬭瘯GetTop鏂规硶, 榛樿鍙傛暟 + DataTable dt = db.GetTop(100, "sys_Log", "", null, ""); + ShowResult($"list={dt.Rows.Count}"); + + //娴嬭瘯GetTop鏂规硶 - 浼犲叆鎸囧畾鍙傛暟 + DbParameter p1 = db.CreateParameter("TableName", "tb_POs"); + DbParameter p2 = db.CreateParameter("LogUser", "admin"); + List<DbParameter> list = new List<DbParameter>(); + list.Add(p1); + list.Add(p2); + + DataTable dt1 = db.GetTop(100, "sys_Log", "isid,LogUser,LogDate,TableName", list, "isid DESC"); + ShowResult($"list={dt1.Rows.Count}"); + + dataGridView1.AutoGenerateColumns = true; + dataGridView1.DataSource = dt1; + } + } +} diff --git a/CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.resx b/CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.resx @@ -0,0 +1,120 @@ +锘�<?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 diff --git a/CSFramework.DB.Source/CSFramework.DBTester/logo.ico b/CSFramework.DB.Source/CSFramework.DBTester/logo.ico new file mode 100644 index 0000000..6bf1a18 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/logo.ico Binary files differ diff --git a/CSFramework.DB.Source/CSFramework.DBTester/sys_AdminUser.cs b/CSFramework.DB.Source/CSFramework.DBTester/sys_AdminUser.cs new file mode 100644 index 0000000..b51546b --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/sys_AdminUser.cs @@ -0,0 +1,34 @@ +锘縰sing CSFramework.DB; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CSFramework.DBTester +{ + //鎸囧畾琛ㄥ悕锛屾瘮濡侻ySQL鎵�鏈夎〃鍚嶉粯璁ゆ槸灏忓啓锛孫racle鍏ㄥぇ鍐� + //[TableInfoAttribute("sys_adminuser")] + [TableInfoAttribute("SYS_ADMINUSER")] + //[TableInfoAttribute("sys_AdminUser")] + public class sys_AdminUser + { + public int isid { get; set; } + + public string AccountType { get; set; } + + public string Account { get; set; } + + public string AccountName { get; set; } + + public string Password { get; set; } + + public string FlagLock { get; set; } + + public DateTime LastLoginTime { get; set; } + + public int LoginCount { get; set; } + + public decimal Amount { get; set; } + } +} diff --git a/CSFramework.DB.Source/CSFramework.DBTester/sys_Log.cs b/CSFramework.DB.Source/CSFramework.DBTester/sys_Log.cs new file mode 100644 index 0000000..97a9f2a --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/sys_Log.cs @@ -0,0 +1,41 @@ +锘縰sing CSFramework.DB; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CSFramework.DBTester +{ + + + [TableInfoAttribute("sys_Log")] + public class sys_Log + { + //鏍囪瘑璇ュ瓧娈典负涓婚敭 + [KeyField] + public string GUID32 { get; set; } + + //璇ュ瓧娈典负鑷瀛楁锛屽拷鐣� + [IgnoreField] + public int isid { get; set; } + + public string DocNo { get; set; } + + public string LogUser { get; set; } + + public int OPType { get; set; } + + public DateTime LogDate { get; set; } + + public bool IsProcess { get; set; } + + //蹇界暐鐨勫瓧娈� + [IgnoreField] + public string IgnoreField1 { get; set; } + + //蹇界暐鐨勫瓧娈� + [IgnoreField] + public string IgnoreField2 { get; set; } + } +} diff --git a/CSFramework.DB.Source/CSFramework.DBTester/sys_RegisterLog.cs b/CSFramework.DB.Source/CSFramework.DBTester/sys_RegisterLog.cs new file mode 100644 index 0000000..40912c0 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBTester/sys_RegisterLog.cs @@ -0,0 +1,24 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CSFramework.DBTester +{ + public class sys_RegisterLog + { + public int isid { get; set; } + + public string LicenseID { get; set; } + + public string RegisterNo { get; set; } + + public DateTime RegisterTime { get; set; } + + public string LogConent { get; set; } + + public string HID { get; set; } + + } +} diff --git a/CSFramework.DB.Source/CSFramework.DBV2.0.sln b/CSFramework.DB.Source/CSFramework.DBV2.0.sln new file mode 100644 index 0000000..529e737 --- /dev/null +++ b/CSFramework.DB.Source/CSFramework.DBV2.0.sln @@ -0,0 +1,31 @@ +锘� +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.1525 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSFramework.DB", "CSFramework.DB\CSFramework.DB.csproj", "{8AE59D09-994C-4E82-BEC7-69C5977B659F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSFramework.DBTester", "CSFramework.DBTester\CSFramework.DBTester.csproj", "{EBE7B1E8-6D76-43A2-A765-653847F0CC8B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8AE59D09-994C-4E82-BEC7-69C5977B659F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8AE59D09-994C-4E82-BEC7-69C5977B659F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8AE59D09-994C-4E82-BEC7-69C5977B659F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8AE59D09-994C-4E82-BEC7-69C5977B659F}.Release|Any CPU.Build.0 = Release|Any CPU + {EBE7B1E8-6D76-43A2-A765-653847F0CC8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EBE7B1E8-6D76-43A2-A765-653847F0CC8B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EBE7B1E8-6D76-43A2-A765-653847F0CC8B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EBE7B1E8-6D76-43A2-A765-653847F0CC8B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {277D77C4-307A-434F-8CEF-6D612FEC89E6} + EndGlobalSection +EndGlobal diff --git a/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/App.config b/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/App.config @@ -0,0 +1,6 @@ +锘�<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> + </startup> +</configuration> \ No newline at end of file diff --git a/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/CSFrameworkV5.Core.Tester.csproj b/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/CSFrameworkV5.Core.Tester.csproj new file mode 100644 index 0000000..7dbd6fb --- /dev/null +++ b/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/CSFrameworkV5.Core.Tester.csproj @@ -0,0 +1,60 @@ +锘�<?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>{4FCCF76F-F0A1-42BC-B77B-DF612DC3E976}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>CSFrameworkV5.Core.Tester</RootNamespace> + <AssemblyName>CSFrameworkV5.Core.Tester</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <Deterministic>true</Deterministic> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\Debug\</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="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Tester.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\CSFrameworkV5.Core\CSFrameworkV5.Core.csproj"> + <Project>{2A59861C-5D4D-4768-B31F-7F59A8517DAE}</Project> + <Name>CSFrameworkV5.Core</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project> \ No newline at end of file diff --git a/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Program.cs b/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Program.cs new file mode 100644 index 0000000..b408a68 --- /dev/null +++ b/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Program.cs @@ -0,0 +1,16 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CSFrameworkV5.Core.Tester +{ + class Program + { + static void Main(string[] args) + { + Tester.Do(); + } + } +} diff --git a/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Properties/AssemblyInfo.cs b/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..dce214d --- /dev/null +++ b/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +锘縰sing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅 +// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼 +// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭�� +[assembly: AssemblyTitle("CSFrameworkV5.Core.Tester")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CSFrameworkV5.Core.Tester")] +[assembly: AssemblyCopyright("Copyright 漏 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 灏� ComVisible 璁剧疆涓� false 浼氫娇姝ょ▼搴忛泦涓殑绫诲瀷 +//瀵� COM 缁勪欢涓嶅彲瑙併�傚鏋滈渶瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷 +//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规�ц缃负 true銆� +[assembly: ComVisible(false)] + +// 濡傛灉姝ら」鐩悜 COM 鍏紑锛屽垯涓嬪垪 GUID 鐢ㄤ簬绫诲瀷搴撶殑 ID +[assembly: Guid("4fccf76f-f0a1-42bc-b77b-df612dc3e976")] + +// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�: +// +// 涓荤増鏈� +// 娆$増鏈� +// 鐢熸垚鍙� +// 淇鍙� +// +// 鍙互鎸囧畾鎵�鏈夊�硷紝涔熷彲浠ヤ娇鐢ㄤ互涓嬫墍绀虹殑 "*" 棰勭疆鐗堟湰鍙峰拰淇鍙� +// 鏂规硶鏄寜濡備笅鎵�绀轰娇鐢ㄢ��*鈥�: : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Tester.cs b/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Tester.cs new file mode 100644 index 0000000..5c033f6 --- /dev/null +++ b/CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Tester.cs @@ -0,0 +1,52 @@ +锘縰sing CSFrameworkV5.Core.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CSFrameworkV5.Core.Tester +{ + class Tester + { + internal static void Do() + { + var s = DataConverter.ImgToBase64String(@"C:\Users\Administrator\Desktop\pubimg\6868.png"); + Console.WriteLine(s); + + var img= DataConverter.Base64StringToImage(s); + img.Dispose(); + + return; + + + + var a = CryptoHelper.RSAEncrypt("csframework.com", RASKey()); + Console.WriteLine(a); + + var b = CryptoHelper.RSADecrypt(a, RASKey()); + Console.WriteLine(b); + + Console.ReadLine(); + } + + static string RASKey() + { + var key = @"<RSAKeyValue><Modulus>5m9m14XH3oqLJ8bNGw9e4rGpXpcktv9MSkHSVFVMjHbfv+SJ5v0ubqQxa5YjLN4vc49z7SVju8s0X4gZ6AzZTn06jzWOgyPRV54Q4I0DCYadWW4Ze3e+BOtwgVU1Og3qHKn8vygoj40J6U85Z/PTJu3hN1m75Zr195ju7g9v4Hk=</Modulus><Exponent>AQAB</Exponent><P>/hf2dnK7rNfl3lbqghWcpFdu778hUpIEBixCDL5WiBtpkZdpSw90aERmHJYaW2RGvGRi6zSftLh00KHsPcNUMw==</P><Q>6Cn/jOLrPapDTEp1Fkq+uz++1Do0eeX7HYqi9rY29CqShzCeI7LEYOoSwYuAJ3xA/DuCdQENPSoJ9KFbO4Wsow==</Q><DP>ga1rHIJro8e/yhxjrKYo/nqc5ICQGhrpMNlPkD9n3CjZVPOISkWF7FzUHEzDANeJfkZhcZa21z24aG3rKo5Qnw==</DP><DQ>MNGsCB8rYlMsRZ2ek2pyQwO7h/sZT8y5ilO9wu08Dwnot/7UMiOEQfDWstY3w5XQQHnvC9WFyCfP4h4QBissyw==</DQ><InverseQ>EG02S7SADhH1EVT9DD0Z62Y0uY7gIYvxX/uq+IzKSCwB8M2G7Qv9xgZQaQlLpCaeKbux3Y59hHM+KpamGL19Kg==</InverseQ><D>vmaYHEbPAgOJvaEXQl+t8DQKFT1fudEysTy31LTyXjGu6XiltXXHUuZaa2IPyHgBz0Nd7znwsW/S44iql0Fen1kzKioEL3svANui63O3o5xdDeExVM6zOf1wUUh/oldovPweChyoAdMtUzgvCbJk1sYDJf++Nr0FeNW1RB1XG30=</D></RSAKeyValue>"; + return key; + + + StringBuilder sb = new StringBuilder(); + + sb.AppendLine("-----BEGIN PUBLIC KEY-----"); + sb.AppendLine("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDHc+PP8LuTlBL1zCX+lh9kcur"); + sb.AppendLine("gHHIXFnV/tDK789DaJuhwZvQ1lu5Zdcn+ULbNUKkB6b5tCP0sZxlpoCVKMyKHtde"); + sb.AppendLine("h/YGXwBD8sMc+XcRs0eh3/tyr4EoBu3bomzHWDGmHjH/F5GotFTrGcB6xQwAROy4"); + sb.AppendLine("mT5SketlQ3c7tucI+QIDAQAB"); + sb.AppendLine("-----END PUBLIC KEY-----"); + + return sb.ToString(); + } + + } +} diff --git a/CSFrameworkV5.Core/CSFrameworkV5.Core.sln b/CSFrameworkV5.Core/CSFrameworkV5.Core.sln new file mode 100644 index 0000000..e089bc8 --- /dev/null +++ b/CSFrameworkV5.Core/CSFrameworkV5.Core.sln @@ -0,0 +1,41 @@ +锘� +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.1525 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSFrameworkV5.Core", "CSFrameworkV5.Core\CSFrameworkV5.Core.csproj", "{2A59861C-5D4D-4768-B31F-7F59A8517DAE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSFrameworkV5.Core.Tester", "CSFrameworkV5.Core.Tester\CSFrameworkV5.Core.Tester.csproj", "{4FCCF76F-F0A1-42BC-B77B-DF612DC3E976}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2A59861C-5D4D-4768-B31F-7F59A8517DAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A59861C-5D4D-4768-B31F-7F59A8517DAE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A59861C-5D4D-4768-B31F-7F59A8517DAE}.Debug|x86.ActiveCfg = Debug|x86 + {2A59861C-5D4D-4768-B31F-7F59A8517DAE}.Debug|x86.Build.0 = Debug|x86 + {2A59861C-5D4D-4768-B31F-7F59A8517DAE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A59861C-5D4D-4768-B31F-7F59A8517DAE}.Release|Any CPU.Build.0 = Release|Any CPU + {2A59861C-5D4D-4768-B31F-7F59A8517DAE}.Release|x86.ActiveCfg = Release|x86 + {2A59861C-5D4D-4768-B31F-7F59A8517DAE}.Release|x86.Build.0 = Release|x86 + {4FCCF76F-F0A1-42BC-B77B-DF612DC3E976}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4FCCF76F-F0A1-42BC-B77B-DF612DC3E976}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4FCCF76F-F0A1-42BC-B77B-DF612DC3E976}.Debug|x86.ActiveCfg = Debug|Any CPU + {4FCCF76F-F0A1-42BC-B77B-DF612DC3E976}.Debug|x86.Build.0 = Debug|Any CPU + {4FCCF76F-F0A1-42BC-B77B-DF612DC3E976}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4FCCF76F-F0A1-42BC-B77B-DF612DC3E976}.Release|Any CPU.Build.0 = Release|Any CPU + {4FCCF76F-F0A1-42BC-B77B-DF612DC3E976}.Release|x86.ActiveCfg = Release|Any CPU + {4FCCF76F-F0A1-42BC-B77B-DF612DC3E976}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {264FE228-71F0-48AB-997B-E99C98DEA625} + EndGlobalSection +EndGlobal -- Gitblit v1.9.3