.gitignore
@@ -184,3 +184,4 @@ # Microsoft Fakes FakesAssemblies/ /CSFrameworkV5.ClientFoundation/.idea/.idea.CSFrameworkV5-ClientFoundation/.idea 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> 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> CSFramework.DB.Source/CSFramework.DBTester/Class1.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CSFramework.DBTester { class Class1 { } } CSFramework.DB.Source/CSFramework.DBTester/Program.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,87 @@ using 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; ////å®ä¾åDbCommandçæå¨ //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); } } } CSFramework.DB.Source/CSFramework.DBTester/Properties/AssemblyInfo.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,36 @@ using 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")] CSFramework.DB.Source/CSFramework.DBTester/Properties/Resources.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,63 @@ //------------------------------------------------------------------------------ // <auto-generated> // æ¤ä»£ç ç±å·¥å ·çæã // è¿è¡æ¶çæ¬:4.0.30319.42000 // // å¯¹æ¤æä»¶çæ´æ¹å¯è½ä¼å¯¼è´ä¸æ£ç¡®çè¡ä¸ºï¼å¹¶ä¸å¦æ // éæ°çæä»£ç ï¼è¿äºæ´æ¹å°ä¼ä¸¢å¤±ã // </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; } } } } 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> CSFramework.DB.Source/CSFramework.DBTester/Properties/Settings.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,26 @@ //------------------------------------------------------------------------------ // <auto-generated> // æ¤ä»£ç ç±å·¥å ·çæã // è¿è¡æ¶çæ¬:4.0.30319.42000 // // å¯¹æ¤æä»¶çæ´æ¹å¯è½ä¼å¯¼è´ä¸æ£ç¡®çè¡ä¸ºï¼å¹¶ä¸å¦æ // éæ°çæä»£ç ï¼è¿äºæ´æ¹å°ä¼ä¸¢å¤±ã // </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; } } } } 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> CSFramework.DB.Source/CSFramework.DBTester/_TestDataUpdate.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,107 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; /*=================================================================== * ç¨åºè¯´æ: tb__TestDataUpdateçORM模å * ä½è èµæ: åä¸å * åå»ºæ¥æ: 2021-06-11 02:13:50 * æåä¿®æ¹: 2021-06-11 02:13:50 * * 注: æ¬æä»¶ç±ä»£ç çæå¨(Code Generator)èªå¨çæã * (æ¤æºç æä»¶è¯·æ¾ç½®å¨ YourProject.Models 模å)ã * çæææ Copyright 2006~2021, C/Sæ¡æ¶ç½(www.cscode.net) *===================================================================*/ namespace CSFramework.DBTester { ///<summary> /// ORM模å, æ°æ®è¡¨:_TestDataUpdate,ç±ClassGeneratorèªå¨çæ /// </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 } } CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,248 @@ namespace 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 = "é¿éäºECSæå¡å¨"; 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æ¶æå¿«éå¼åæ¡æ¶SQLå¹¶åæµè¯ååæµè¯ï¼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; } } CSFramework.DB.Source/CSFramework.DBTester/frmSQLConcurrentTester.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,332 @@ using 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ï¼C/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); //æ½ç¾ï¼go<=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}个SQLè¿æ¥!" }); 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); } 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> CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,470 @@ namespace 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; } } CSFramework.DB.Source/CSFramework.DBTester/frmTestDB.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,737 @@ using 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("é»è®¤ä¸ºSQLServerè¿æ¥"); 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("设置为SQLServerè¿æ¥"); } 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("设置为MySQLè¿æ¥"); MessageBox.Show("请修æ¹connstringçå¯ç "); 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) { // //æµè¯æ¡ä¾ï¼æäº¤DataTableï¼æ¹éä¿®æ¹æäº¤å¤æ¡è®°å½ // 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) { // //æµè¯æ¡ä¾ï¼æäº¤DataSetï¼æ¹éä¿®æ¹ãæäº¤å¤è¡¨å¤æ¡è®°å½ // 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æ¯æä¸¤ç§ç©ºé´æ°æ®ç±»åï¼geometryågeography.å ¶ä¸geometryæ°æ®ç±»åæ¯æå¹³é¢æå¹³é¢çæ°æ®, //geographyå¯ç¨äºåå¨GPSç»åº¦åçº¬åº¦åæ çæ¤ç使°æ®ã //geometryågeographyæ°æ®ç±»ååºäºgeometry屿¬¡ç»æã _Geography = "POINT(55.9271035250276 -3.29431266523898)", //Geography ç±»åæ°æ®ç»æ _Geometry = "POINT(55.9271035250276 -3.29431266523898)", //Geometry ç±»åæ°æ®ç»æ //æè¦:hierarchyid æ°æ®ç±»åï¼æ¯sqlserver 2008䏿°å¢çä¸ä¸ªCLRæ°æ®ç±»åï¼æ¤æ°æ®ç±»ååºç¨äºåå¨å ·æå±çº§çç»æå¾ _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) { //è§£å³æ¹æ¡ï¼ //è¿æ¥å符串å é¤ï¼Allow Zero Datetime=True; å ä¸ï¼Convert 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æ¯æä¸¤ç§ç©ºé´æ°æ®ç±»åï¼geometryågeography.å ¶ä¸geometryæ°æ®ç±»åæ¯æå¹³é¢æå¹³é¢çæ°æ®, //geographyå¯ç¨äºåå¨GPSç»åº¦åçº¬åº¦åæ çæ¤ç使°æ®ã //geometryågeographyæ°æ®ç±»ååºäºgeometry屿¬¡ç»æã _Geography = "POINT(55.9271035250276 -3.29431266523898)", //Geography ç±»åæ°æ®ç»æ _Geometry = "POINT(55.9271035250276 -3.29431266523898)", //Geometry ç±»åæ°æ®ç»æ //æè¦:hierarchyid æ°æ®ç±»åï¼æ¯sqlserver 2008䏿°å¢çä¸ä¸ªCLRæ°æ®ç±»åï¼æ¤æ°æ®ç±»ååºç¨äºåå¨å ·æå±çº§çç»æå¾ _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}"); //æ¥è¯¢ä¿®æ¹åTimestampçå¼ _testdataupdate o1 = db.ExecuteReader<_testdataupdate>("SELECT * FROM _testdataupdate WHERE isid=1;"); ShowResult($"timestampå¼ï¼ä¿®æ¹åï¼:{o1._Timestamp}"); //æµè¯æ¥éª¤2ï¼Timestampç±»åçåæ®µä½ä¸ºä¸»é®æ´æ°æ°æ® 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 //æå®å¿½ç¥æ´æ°+æ´æ°çåæ®µï¼æ¤æ¹æ¡ignoreFieldsåæ°æ æï¼ç¨åºä¸å¤çï¼ 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; } } } 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> CSFramework.DB.Source/CSFramework.DBTester/logo.ico
CSFramework.DB.Source/CSFramework.DBTester/sys_AdminUser.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,34 @@ using CSFramework.DB; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CSFramework.DBTester { //æå®è¡¨åï¼æ¯å¦MySQLææè¡¨åé»è®¤æ¯å°åï¼Oracleå ¨å¤§å //[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; } } } CSFramework.DB.Source/CSFramework.DBTester/sys_Log.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,41 @@ using 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; } } } CSFramework.DB.Source/CSFramework.DBTester/sys_RegisterLog.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,24 @@ using 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; } } } 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 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> 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> CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Program.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,16 @@ using 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(); } } } CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Properties/AssemblyInfo.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,36 @@ using 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")] CSFrameworkV5.Core/CSFrameworkV5.Core.Tester/Tester.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,52 @@ using 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(); } } } 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