Bläddra i källkod

数据库设置

jz.kai 10 månader sedan
förälder
incheckning
8a90b6e551

+ 0 - 3
DBUtility/DBUtility.csproj

@@ -139,9 +139,6 @@
     </Compile>
     <Compile Include="DESEncrypt.cs" />
     <Compile Include="PubConstant.cs" />
-    <Compile Include="SQLHelper.cs">
-      <SubType>Code</SubType>
-    </Compile>
   </ItemGroup>
   <ItemGroup>
     <BootstrapperPackage Include="Microsoft.Net.Client.3.5">

+ 1 - 1
DBUtility/PubConstant.cs

@@ -12,7 +12,7 @@ namespace Maticsoft.DBUtility
         {           
             get 
             {
-                string _connectionString = ConfigurationManager.AppSettings["ConnectionString"];       
+                string _connectionString = ConfigurationManager.AppSettings["ConnectionString"];
                 string ConStringEncrypt = ConfigurationManager.AppSettings["ConStringEncrypt"];
                 if (ConStringEncrypt == "true")
                 {

+ 0 - 249
DBUtility/SQLHelper.cs

@@ -1,249 +0,0 @@
-//===============================================================================
-// This file is based on the Microsoft Data Access Application Block for .NET
-// For more information please go to 
-// http://msdn.microsoft.com/library/en-us/dnbda/html/daab-rm.asp
-//===============================================================================
-
-using System;
-using System.Configuration;
-using System.Data;
-using System.Data.SqlClient;
-using System.Collections;
-
-namespace Maticsoft.DBUtility
-{
-
-    /// <summary>
-    /// The SqlHelper class is intended to encapsulate high performance, 
-    /// scalable best practices for common uses of SqlClient.
-    /// </summary>
-    public abstract class SqlHelper
-    {
-
-        //Database connection strings
-        public static readonly string ConnectionStringLocalTransaction =  ConfigurationManager.AppSettings["SQLConnString1"];
-        public static readonly string ConnectionStringInventoryDistributedTransaction =  ConfigurationManager.AppSettings["SQLConnString2"];
-        public static readonly string ConnectionStringOrderDistributedTransaction =  ConfigurationManager.AppSettings["SQLConnString3"];
-        public static readonly string ConnectionStringProfile =  ConfigurationManager.AppSettings["SQLProfileConnString"];
-
-        // Hashtable to store cached parameters
-        private static Hashtable parmCache = Hashtable.Synchronized(new Hashtable());
-
-        /// <summary>
-        /// Execute a SqlCommand (that returns no resultset) against the database specified in the connection string 
-        /// using the provided parameters.
-        /// </summary>
-        /// <remarks>
-        /// e.g.:  
-        ///  int result = ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
-        /// </remarks>
-        /// <param name="connectionString">a valid connection string for a SqlConnection</param>
-        /// <param name="commandType">the CommandType (stored procedure, text, etc.)</param>
-        /// <param name="commandText">the stored procedure name or T-SQL command</param>
-        /// <param name="commandParameters">an array of SqlParamters used to execute the command</param>
-        /// <returns>an int representing the number of rows affected by the command</returns>
-        public static int ExecuteNonQuery(string connectionString, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
-        {
-
-            SqlCommand cmd = new SqlCommand();
-
-            using (SqlConnection conn = new SqlConnection(connectionString))
-            {
-                PrepareCommand(cmd, conn, null, cmdType, cmdText, commandParameters);
-                int val = cmd.ExecuteNonQuery();
-                cmd.Parameters.Clear();
-                return val;
-            }
-        }
-
-        /// <summary>
-        /// Execute a SqlCommand (that returns no resultset) against an existing database connection 
-        /// using the provided parameters.
-        /// </summary>
-        /// <remarks>
-        /// e.g.:  
-        ///  int result = ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
-        /// </remarks>
-        /// <param name="conn">an existing database connection</param>
-        /// <param name="commandType">the CommandType (stored procedure, text, etc.)</param>
-        /// <param name="commandText">the stored procedure name or T-SQL command</param>
-        /// <param name="commandParameters">an array of SqlParamters used to execute the command</param>
-        /// <returns>an int representing the number of rows affected by the command</returns>
-        public static int ExecuteNonQuery(SqlConnection connection, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
-        {
-
-            SqlCommand cmd = new SqlCommand();
-
-            PrepareCommand(cmd, connection, null, cmdType, cmdText, commandParameters);
-            int val = cmd.ExecuteNonQuery();
-            cmd.Parameters.Clear();
-            return val;
-        }
-
-        /// <summary>
-        /// Execute a SqlCommand (that returns no resultset) using an existing SQL Transaction 
-        /// using the provided parameters.
-        /// </summary>
-        /// <remarks>
-        /// e.g.:  
-        ///  int result = ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
-        /// </remarks>
-        /// <param name="trans">an existing sql transaction</param>
-        /// <param name="commandType">the CommandType (stored procedure, text, etc.)</param>
-        /// <param name="commandText">the stored procedure name or T-SQL command</param>
-        /// <param name="commandParameters">an array of SqlParamters used to execute the command</param>
-        /// <returns>an int representing the number of rows affected by the command</returns>
-        public static int ExecuteNonQuery(SqlTransaction trans, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
-        {
-            SqlCommand cmd = new SqlCommand();
-            PrepareCommand(cmd, trans.Connection, trans, cmdType, cmdText, commandParameters);
-            int val = cmd.ExecuteNonQuery();
-            cmd.Parameters.Clear();
-            return val;
-        }
-
-        /// <summary>
-        /// Execute a SqlCommand that returns a resultset against the database specified in the connection string 
-        /// using the provided parameters.
-        /// </summary>
-        /// <remarks>
-        /// e.g.:  
-        ///  SqlDataReader r = ExecuteReader(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
-        /// </remarks>
-        /// <param name="connectionString">a valid connection string for a SqlConnection</param>
-        /// <param name="commandType">the CommandType (stored procedure, text, etc.)</param>
-        /// <param name="commandText">the stored procedure name or T-SQL command</param>
-        /// <param name="commandParameters">an array of SqlParamters used to execute the command</param>
-        /// <returns>A SqlDataReader containing the results</returns>
-        public static SqlDataReader ExecuteReader(string connectionString, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
-        {
-            SqlCommand cmd = new SqlCommand();
-            SqlConnection conn = new SqlConnection(connectionString);
-
-            // we use a try/catch here because if the method throws an exception we want to 
-            // close the connection throw code, because no datareader will exist, hence the 
-            // commandBehaviour.CloseConnection will not work
-            try
-            {
-                PrepareCommand(cmd, conn, null, cmdType, cmdText, commandParameters);
-                SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
-                cmd.Parameters.Clear();
-                return rdr;
-            }
-            catch
-            {
-                conn.Close();
-                throw;
-            }
-        }
-
-        /// <summary>
-        /// Execute a SqlCommand that returns the first column of the first record against the database specified in the connection string 
-        /// using the provided parameters.
-        /// </summary>
-        /// <remarks>
-        /// e.g.:  
-        ///  Object obj = ExecuteScalar(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
-        /// </remarks>
-        /// <param name="connectionString">a valid connection string for a SqlConnection</param>
-        /// <param name="commandType">the CommandType (stored procedure, text, etc.)</param>
-        /// <param name="commandText">the stored procedure name or T-SQL command</param>
-        /// <param name="commandParameters">an array of SqlParamters used to execute the command</param>
-        /// <returns>An object that should be converted to the expected type using Convert.To{Type}</returns>
-        public static object ExecuteScalar(string connectionString, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
-        {
-            SqlCommand cmd = new SqlCommand();
-
-            using (SqlConnection connection = new SqlConnection(connectionString))
-            {
-                PrepareCommand(cmd, connection, null, cmdType, cmdText, commandParameters);
-                object val = cmd.ExecuteScalar();
-                cmd.Parameters.Clear();
-                return val;
-            }
-        }
-
-        /// <summary>
-        /// Execute a SqlCommand that returns the first column of the first record against an existing database connection 
-        /// using the provided parameters.
-        /// </summary>
-        /// <remarks>
-        /// e.g.:  
-        ///  Object obj = ExecuteScalar(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
-        /// </remarks>
-        /// <param name="conn">an existing database connection</param>
-        /// <param name="commandType">the CommandType (stored procedure, text, etc.)</param>
-        /// <param name="commandText">the stored procedure name or T-SQL command</param>
-        /// <param name="commandParameters">an array of SqlParamters used to execute the command</param>
-        /// <returns>An object that should be converted to the expected type using Convert.To{Type}</returns>
-        public static object ExecuteScalar(SqlConnection connection, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
-        {
-
-            SqlCommand cmd = new SqlCommand();
-
-            PrepareCommand(cmd, connection, null, cmdType, cmdText, commandParameters);
-            object val = cmd.ExecuteScalar();
-            cmd.Parameters.Clear();
-            return val;
-        }
-
-        /// <summary>
-        /// add parameter array to the cache
-        /// </summary>
-        /// <param name="cacheKey">Key to the parameter cache</param>
-        /// <param name="cmdParms">an array of SqlParamters to be cached</param>
-        public static void CacheParameters(string cacheKey, params SqlParameter[] commandParameters)
-        {
-            parmCache[cacheKey] = commandParameters;
-        }
-
-        /// <summary>
-        /// Retrieve cached parameters
-        /// </summary>
-        /// <param name="cacheKey">key used to lookup parameters</param>
-        /// <returns>Cached SqlParamters array</returns>
-        public static SqlParameter[] GetCachedParameters(string cacheKey)
-        {
-            SqlParameter[] cachedParms = (SqlParameter[])parmCache[cacheKey];
-
-            if (cachedParms == null)
-                return null;
-
-            SqlParameter[] clonedParms = new SqlParameter[cachedParms.Length];
-
-            for (int i = 0, j = cachedParms.Length; i < j; i++)
-                clonedParms[i] = (SqlParameter)((ICloneable)cachedParms[i]).Clone();
-
-            return clonedParms;
-        }
-
-        /// <summary>
-        /// Prepare a command for execution
-        /// </summary>
-        /// <param name="cmd">SqlCommand object</param>
-        /// <param name="conn">SqlConnection object</param>
-        /// <param name="trans">SqlTransaction object</param>
-        /// <param name="cmdType">Cmd type e.g. stored procedure or text</param>
-        /// <param name="cmdText">Command text, e.g. Select * from Products</param>
-        /// <param name="cmdParms">SqlParameters to use in the command</param>
-        private static void PrepareCommand(SqlCommand cmd, SqlConnection conn, SqlTransaction trans, CommandType cmdType, string cmdText, SqlParameter[] cmdParms)
-        {
-            if (conn.State != ConnectionState.Open)
-                conn.Open();
-
-            cmd.Connection = conn;
-            cmd.CommandText = cmdText;
-
-            if (trans != null)
-                cmd.Transaction = trans;
-
-            cmd.CommandType = cmdType;
-
-            if (cmdParms != null)
-            {
-                foreach (SqlParameter parm in cmdParms)
-                    cmd.Parameters.Add(parm);
-            }
-        }
-    }
-}

+ 5 - 0
WinForms/App.config

@@ -2,6 +2,11 @@
 <configuration>
   <appSettings>
     <add key="ConnectionString" value="server=114.55.55.123;port=3306;database=printing;uid=root;password=jpsoft8121234" />
+	<add key="ConnIP" value="114.55.55.123" />
+	<add key="ConnPort" value="3306" />
+	<add key="ConnName" value="printing" />
+	<add key="ConnUser" value="root" />
+	<add key="ConnPWD" value="jpsoft8121234" />
   </appSettings>
   <startup useLegacyV2RuntimeActivationPolicy="true">
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />

+ 194 - 13
WinForms/Configure.Designer.cs

@@ -33,7 +33,23 @@
             this.tabPage2 = new System.Windows.Forms.TabPage();
             this.tabPage3 = new System.Windows.Forms.TabPage();
             this.tabPage4 = new System.Windows.Forms.TabPage();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.dbTextBox1 = new System.Windows.Forms.TextBox();
+            this.dbLabel1 = new System.Windows.Forms.Label();
+            this.dbTextBox2 = new System.Windows.Forms.TextBox();
+            this.dbLabel2 = new System.Windows.Forms.Label();
+            this.dbTextBox3 = new System.Windows.Forms.TextBox();
+            this.dbLabel3 = new System.Windows.Forms.Label();
+            this.dbTextBox4 = new System.Windows.Forms.TextBox();
+            this.dbLabel4 = new System.Windows.Forms.Label();
+            this.dbTextBox5 = new System.Windows.Forms.TextBox();
+            this.dbLabel5 = new System.Windows.Forms.Label();
+            this.btnCancel = new System.Windows.Forms.Button();
+            this.btnSubmit = new System.Windows.Forms.Button();
             this.tabControl1.SuspendLayout();
+            this.tabPage1.SuspendLayout();
+            this.tabPage2.SuspendLayout();
             this.SuspendLayout();
             // 
             // tabControl1
@@ -42,31 +58,43 @@
             this.tabControl1.Controls.Add(this.tabPage2);
             this.tabControl1.Controls.Add(this.tabPage3);
             this.tabControl1.Controls.Add(this.tabPage4);
-            this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tabControl1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.tabControl1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.tabControl1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.tabControl1.Location = new System.Drawing.Point(0, 0);
             this.tabControl1.Multiline = true;
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
-            this.tabControl1.Size = new System.Drawing.Size(800, 450);
+            this.tabControl1.Size = new System.Drawing.Size(536, 296);
             this.tabControl1.TabIndex = 1;
             // 
             // tabPage1
             // 
-            this.tabPage1.Location = new System.Drawing.Point(4, 26);
+            this.tabPage1.Controls.Add(this.textBox1);
+            this.tabPage1.Controls.Add(this.label1);
+            this.tabPage1.Location = new System.Drawing.Point(4, 30);
             this.tabPage1.Name = "tabPage1";
             this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage1.Size = new System.Drawing.Size(792, 420);
+            this.tabPage1.Size = new System.Drawing.Size(792, 416);
             this.tabPage1.TabIndex = 0;
             this.tabPage1.Text = "串口";
             this.tabPage1.UseVisualStyleBackColor = true;
             // 
             // tabPage2
             // 
-            this.tabPage2.Location = new System.Drawing.Point(4, 26);
+            this.tabPage2.Controls.Add(this.dbTextBox5);
+            this.tabPage2.Controls.Add(this.dbLabel5);
+            this.tabPage2.Controls.Add(this.dbTextBox4);
+            this.tabPage2.Controls.Add(this.dbLabel4);
+            this.tabPage2.Controls.Add(this.dbTextBox3);
+            this.tabPage2.Controls.Add(this.dbLabel3);
+            this.tabPage2.Controls.Add(this.dbTextBox2);
+            this.tabPage2.Controls.Add(this.dbLabel2);
+            this.tabPage2.Controls.Add(this.dbTextBox1);
+            this.tabPage2.Controls.Add(this.dbLabel1);
+            this.tabPage2.Location = new System.Drawing.Point(4, 30);
             this.tabPage2.Name = "tabPage2";
             this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage2.Size = new System.Drawing.Size(755, 420);
+            this.tabPage2.Size = new System.Drawing.Size(528, 262);
             this.tabPage2.TabIndex = 1;
             this.tabPage2.Text = "数据库";
             this.tabPage2.UseVisualStyleBackColor = true;
@@ -75,7 +103,7 @@
             // 
             this.tabPage3.Location = new System.Drawing.Point(4, 26);
             this.tabPage3.Name = "tabPage3";
-            this.tabPage3.Size = new System.Drawing.Size(755, 420);
+            this.tabPage3.Size = new System.Drawing.Size(792, 420);
             this.tabPage3.TabIndex = 2;
             this.tabPage3.Text = "采集";
             this.tabPage3.UseVisualStyleBackColor = true;
@@ -84,22 +112,161 @@
             // 
             this.tabPage4.Location = new System.Drawing.Point(4, 26);
             this.tabPage4.Name = "tabPage4";
-            this.tabPage4.Size = new System.Drawing.Size(755, 420);
+            this.tabPage4.Size = new System.Drawing.Size(792, 420);
             this.tabPage4.TabIndex = 3;
             this.tabPage4.Text = "打印";
             this.tabPage4.UseVisualStyleBackColor = true;
             // 
+            // textBox1
+            // 
+            this.textBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.textBox1.Location = new System.Drawing.Point(111, 19);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(385, 29);
+            this.textBox1.TabIndex = 76;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(24, 22);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(58, 21);
+            this.label1.TabIndex = 75;
+            this.label1.Text = "端口:";
+            // 
+            // dbTextBox1
+            // 
+            this.dbTextBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dbTextBox1.Location = new System.Drawing.Point(112, 20);
+            this.dbTextBox1.Name = "dbTextBox1";
+            this.dbTextBox1.Size = new System.Drawing.Size(385, 29);
+            this.dbTextBox1.TabIndex = 78;
+            // 
+            // dbLabel1
+            // 
+            this.dbLabel1.AutoSize = true;
+            this.dbLabel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dbLabel1.Location = new System.Drawing.Point(24, 22);
+            this.dbLabel1.Name = "dbLabel1";
+            this.dbLabel1.Size = new System.Drawing.Size(58, 21);
+            this.dbLabel1.TabIndex = 77;
+            this.dbLabel1.Text = "地址:";
+            // 
+            // dbTextBox2
+            // 
+            this.dbTextBox2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dbTextBox2.Location = new System.Drawing.Point(112, 68);
+            this.dbTextBox2.Name = "dbTextBox2";
+            this.dbTextBox2.Size = new System.Drawing.Size(385, 29);
+            this.dbTextBox2.TabIndex = 80;
+            // 
+            // dbLabel2
+            // 
+            this.dbLabel2.AutoSize = true;
+            this.dbLabel2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dbLabel2.Location = new System.Drawing.Point(24, 71);
+            this.dbLabel2.Name = "dbLabel2";
+            this.dbLabel2.Size = new System.Drawing.Size(58, 21);
+            this.dbLabel2.TabIndex = 79;
+            this.dbLabel2.Text = "端口:";
+            // 
+            // dbTextBox3
+            // 
+            this.dbTextBox3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dbTextBox3.Location = new System.Drawing.Point(112, 117);
+            this.dbTextBox3.Name = "dbTextBox3";
+            this.dbTextBox3.Size = new System.Drawing.Size(385, 29);
+            this.dbTextBox3.TabIndex = 82;
+            // 
+            // dbLabel3
+            // 
+            this.dbLabel3.AutoSize = true;
+            this.dbLabel3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dbLabel3.Location = new System.Drawing.Point(24, 120);
+            this.dbLabel3.Name = "dbLabel3";
+            this.dbLabel3.Size = new System.Drawing.Size(58, 21);
+            this.dbLabel3.TabIndex = 81;
+            this.dbLabel3.Text = "名称:";
+            // 
+            // dbTextBox4
+            // 
+            this.dbTextBox4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dbTextBox4.Location = new System.Drawing.Point(112, 166);
+            this.dbTextBox4.Name = "dbTextBox4";
+            this.dbTextBox4.Size = new System.Drawing.Size(385, 29);
+            this.dbTextBox4.TabIndex = 84;
+            // 
+            // dbLabel4
+            // 
+            this.dbLabel4.AutoSize = true;
+            this.dbLabel4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dbLabel4.Location = new System.Drawing.Point(24, 169);
+            this.dbLabel4.Name = "dbLabel4";
+            this.dbLabel4.Size = new System.Drawing.Size(74, 21);
+            this.dbLabel4.TabIndex = 83;
+            this.dbLabel4.Text = "用户名:";
+            // 
+            // dbTextBox5
+            // 
+            this.dbTextBox5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dbTextBox5.Location = new System.Drawing.Point(112, 215);
+            this.dbTextBox5.Name = "dbTextBox5";
+            this.dbTextBox5.Size = new System.Drawing.Size(385, 29);
+            this.dbTextBox5.TabIndex = 86;
+            // 
+            // dbLabel5
+            // 
+            this.dbLabel5.AutoSize = true;
+            this.dbLabel5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dbLabel5.Location = new System.Drawing.Point(24, 218);
+            this.dbLabel5.Name = "dbLabel5";
+            this.dbLabel5.Size = new System.Drawing.Size(58, 21);
+            this.dbLabel5.TabIndex = 85;
+            this.dbLabel5.Text = "密码:";
+            // 
+            // btnCancel
+            // 
+            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnCancel.Location = new System.Drawing.Point(444, 306);
+            this.btnCancel.Name = "btnCancel";
+            this.btnCancel.Size = new System.Drawing.Size(80, 30);
+            this.btnCancel.TabIndex = 78;
+            this.btnCancel.Text = "取消";
+            this.btnCancel.UseVisualStyleBackColor = true;
+            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+            // 
+            // btnSubmit
+            // 
+            this.btnSubmit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnSubmit.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnSubmit.Location = new System.Drawing.Point(358, 306);
+            this.btnSubmit.Name = "btnSubmit";
+            this.btnSubmit.Size = new System.Drawing.Size(80, 30);
+            this.btnSubmit.TabIndex = 77;
+            this.btnSubmit.Text = "确定";
+            this.btnSubmit.UseVisualStyleBackColor = true;
+            this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
+            // 
             // Configure
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.ClientSize = new System.Drawing.Size(536, 348);
+            this.Controls.Add(this.btnCancel);
+            this.Controls.Add(this.btnSubmit);
             this.Controls.Add(this.tabControl1);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.MaximizeBox = false;
+            this.MinimizeBox = false;
             this.Name = "Configure";
-            this.Text = "Configure";
-            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "设置";
             this.tabControl1.ResumeLayout(false);
+            this.tabPage1.ResumeLayout(false);
+            this.tabPage1.PerformLayout();
+            this.tabPage2.ResumeLayout(false);
+            this.tabPage2.PerformLayout();
             this.ResumeLayout(false);
 
         }
@@ -111,5 +278,19 @@
         private System.Windows.Forms.TabPage tabPage2;
         private System.Windows.Forms.TabPage tabPage3;
         private System.Windows.Forms.TabPage tabPage4;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox dbTextBox1;
+        private System.Windows.Forms.Label dbLabel1;
+        private System.Windows.Forms.TextBox dbTextBox5;
+        private System.Windows.Forms.Label dbLabel5;
+        private System.Windows.Forms.TextBox dbTextBox4;
+        private System.Windows.Forms.Label dbLabel4;
+        private System.Windows.Forms.TextBox dbTextBox3;
+        private System.Windows.Forms.Label dbLabel3;
+        private System.Windows.Forms.TextBox dbTextBox2;
+        private System.Windows.Forms.Label dbLabel2;
+        private System.Windows.Forms.Button btnCancel;
+        private System.Windows.Forms.Button btnSubmit;
     }
 }

+ 41 - 0
WinForms/Configure.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using System.Configuration;
 
 namespace WinForms
 {
@@ -15,6 +16,46 @@ namespace WinForms
         public Configure()
         {
             InitializeComponent();
+            ShowDatabase();
+        }
+
+        private void btnSubmit_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                SaveDatabase();
+                MessageBox.Show("保存成功!");
+                this.DialogResult = DialogResult.OK;
+            }
+            catch(Exception ex)
+            {
+                MessageBox.Show(ex.Message);
+            }
+        }
+
+        private void btnCancel_Click(object sender, EventArgs e)
+        {
+            this.DialogResult = DialogResult.Cancel;
+        }
+
+        private void ShowDatabase()
+        {
+            this.dbTextBox1.Text = ConfigurationManager.AppSettings["ConnIP"];
+            this.dbTextBox2.Text = ConfigurationManager.AppSettings["ConnPort"];
+            this.dbTextBox3.Text = ConfigurationManager.AppSettings["ConnName"];
+            this.dbTextBox4.Text = ConfigurationManager.AppSettings["ConnUser"];
+            this.dbTextBox5.Text = ConfigurationManager.AppSettings["ConnPWD"];
+        }
+
+        private void SaveDatabase()
+        {
+            Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+            configuration.AppSettings.Settings["ConnIP"].Value = this.dbTextBox1.Text.Trim();
+            configuration.AppSettings.Settings["ConnPort"].Value = this.dbTextBox2.Text.Trim();
+            configuration.AppSettings.Settings["ConnName"].Value = this.dbTextBox3.Text.Trim();
+            configuration.AppSettings.Settings["ConnUser"].Value = this.dbTextBox4.Text.Trim();
+            configuration.AppSettings.Settings["ConnPWD"].Value = this.dbTextBox5.Text.Trim();
+            configuration.Save();
         }
     }
 }

+ 114 - 113
WinForms/Default.Designer.cs

@@ -29,12 +29,19 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Default));
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
             this.toolStrip1 = new System.Windows.Forms.ToolStrip();
-            this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
+            this.btnSetting = new System.Windows.Forms.ToolStripButton();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.id_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.stock_number = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.length_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.tag_length = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.flaw_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.status_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.label15 = new System.Windows.Forms.Label();
             this.label14 = new System.Windows.Forms.Label();
             this.label13 = new System.Windows.Forms.Label();
@@ -68,19 +75,12 @@
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.label2 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
-            this.dataGridView1 = new System.Windows.Forms.DataGridView();
-            this.id_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.stock_number = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.length_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.tag_length = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.flaw_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.status_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.toolStrip1.SuspendLayout();
             this.panel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             this.groupBox3.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             this.SuspendLayout();
             // 
             // toolStrip1
@@ -90,23 +90,23 @@
             this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
             this.toolStrip1.ImageScalingSize = new System.Drawing.Size(32, 32);
             this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripButton2});
+            this.btnSetting});
             this.toolStrip1.Location = new System.Drawing.Point(0, 0);
             this.toolStrip1.Name = "toolStrip1";
             this.toolStrip1.Size = new System.Drawing.Size(37, 450);
             this.toolStrip1.TabIndex = 0;
             this.toolStrip1.Text = "toolStrip1";
             // 
-            // toolStripButton2
+            // btnSetting
             // 
-            this.toolStripButton2.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
-            this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
-            this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
-            this.toolStripButton2.Name = "toolStripButton2";
-            this.toolStripButton2.Size = new System.Drawing.Size(34, 53);
-            this.toolStripButton2.Text = "配置";
-            this.toolStripButton2.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
-            this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
+            this.btnSetting.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
+            this.btnSetting.Image = ((System.Drawing.Image)(resources.GetObject("btnSetting.Image")));
+            this.btnSetting.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.btnSetting.Name = "btnSetting";
+            this.btnSetting.Size = new System.Drawing.Size(34, 53);
+            this.btnSetting.Text = "配置";
+            this.btnSetting.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.btnSetting.Click += new System.EventHandler(this.btnSetting_Click);
             // 
             // panel1
             // 
@@ -145,6 +145,96 @@
             this.panel1.Size = new System.Drawing.Size(763, 450);
             this.panel1.TabIndex = 1;
             // 
+            // dataGridView1
+            // 
+            this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
+            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
+            this.dataGridView1.ColumnHeadersHeight = 30;
+            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.id_,
+            this.stock_number,
+            this.length_,
+            this.tag_length,
+            this.flaw_,
+            this.status_});
+            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle2;
+            this.dataGridView1.Location = new System.Drawing.Point(359, 6);
+            this.dataGridView1.Name = "dataGridView1";
+            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
+            dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
+            this.dataGridView1.RowHeadersVisible = false;
+            this.dataGridView1.RowTemplate.Height = 30;
+            this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+            this.dataGridView1.Size = new System.Drawing.Size(398, 352);
+            this.dataGridView1.TabIndex = 71;
+            // 
+            // id_
+            // 
+            this.id_.DataPropertyName = "id_";
+            this.id_.HeaderText = "ID";
+            this.id_.Name = "id_";
+            this.id_.ReadOnly = true;
+            this.id_.Visible = false;
+            this.id_.Width = 52;
+            // 
+            // stock_number
+            // 
+            this.stock_number.DataPropertyName = "stock_number";
+            this.stock_number.HeaderText = "卷号";
+            this.stock_number.Name = "stock_number";
+            this.stock_number.Width = 67;
+            // 
+            // length_
+            // 
+            this.length_.DataPropertyName = "length_";
+            this.length_.HeaderText = "长度";
+            this.length_.Name = "length_";
+            this.length_.Width = 67;
+            // 
+            // tag_length
+            // 
+            this.tag_length.DataPropertyName = "tag_length";
+            this.tag_length.HeaderText = "标签长度";
+            this.tag_length.Name = "tag_length";
+            this.tag_length.Width = 99;
+            // 
+            // flaw_
+            // 
+            this.flaw_.DataPropertyName = "flaw_";
+            this.flaw_.HeaderText = "瑕疵";
+            this.flaw_.Name = "flaw_";
+            this.flaw_.Width = 67;
+            // 
+            // status_
+            // 
+            this.status_.DataPropertyName = "status_";
+            this.status_.HeaderText = "状态";
+            this.status_.Name = "status_";
+            this.status_.Width = 67;
+            // 
             // label15
             // 
             this.label15.AutoSize = true;
@@ -492,95 +582,6 @@
             this.label1.TabIndex = 13;
             this.label1.Text = "米";
             // 
-            // dataGridView1
-            // 
-            this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
-            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
-            dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
-            this.dataGridView1.ColumnHeadersHeight = 30;
-            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.id_,
-            this.stock_number,
-            this.length_,
-            this.tag_length,
-            this.flaw_,
-            this.status_});
-            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle5;
-            this.dataGridView1.Location = new System.Drawing.Point(359, 6);
-            this.dataGridView1.Name = "dataGridView1";
-            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
-            dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
-            this.dataGridView1.RowHeadersVisible = false;
-            this.dataGridView1.RowTemplate.Height = 30;
-            this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
-            this.dataGridView1.Size = new System.Drawing.Size(398, 352);
-            this.dataGridView1.TabIndex = 71;
-            // 
-            // id_
-            // 
-            this.id_.DataPropertyName = "id_";
-            this.id_.HeaderText = "ID";
-            this.id_.Name = "id_";
-            this.id_.ReadOnly = true;
-            this.id_.Visible = false;
-            // 
-            // stock_number
-            // 
-            this.stock_number.DataPropertyName = "stock_number";
-            this.stock_number.HeaderText = "卷号";
-            this.stock_number.Name = "stock_number";
-            this.stock_number.Width = 67;
-            // 
-            // length_
-            // 
-            this.length_.DataPropertyName = "length_";
-            this.length_.HeaderText = "长度";
-            this.length_.Name = "length_";
-            this.length_.Width = 67;
-            // 
-            // tag_length
-            // 
-            this.tag_length.DataPropertyName = "tag_length";
-            this.tag_length.HeaderText = "标签长度";
-            this.tag_length.Name = "tag_length";
-            this.tag_length.Width = 99;
-            // 
-            // flaw_
-            // 
-            this.flaw_.DataPropertyName = "flaw_";
-            this.flaw_.HeaderText = "瑕疵";
-            this.flaw_.Name = "flaw_";
-            this.flaw_.Width = 67;
-            // 
-            // status_
-            // 
-            this.status_.DataPropertyName = "status_";
-            this.status_.HeaderText = "状态";
-            this.status_.Name = "status_";
-            this.status_.Width = 67;
-            // 
             // Default
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -597,13 +598,13 @@
             this.toolStrip1.PerformLayout();
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
             this.groupBox3.ResumeLayout(false);
             this.groupBox3.PerformLayout();
             this.groupBox2.ResumeLayout(false);
             this.groupBox2.PerformLayout();
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -612,7 +613,7 @@
         #endregion
 
         private System.Windows.Forms.ToolStrip toolStrip1;
-        private System.Windows.Forms.ToolStripButton toolStripButton2;
+        private System.Windows.Forms.ToolStripButton btnSetting;
         private System.Windows.Forms.Panel panel1;
         private System.Windows.Forms.Label labTagFactorSave;
         private System.Windows.Forms.Label labColour;

+ 6 - 7
WinForms/Default.cs

@@ -19,13 +19,6 @@ namespace WinForms
             InitializeComponent();
         }
 
-        private void toolStripButton2_Click(object sender, EventArgs e)
-        {
-            Configure configureForm = new Configure();
-            configureForm.TopLevel = false;
-            configureForm.Show();
-        }
-
         private void button10_Click(object sender, EventArgs e)
         {
             SelectWork selectWork = new SelectWork();
@@ -65,5 +58,11 @@ namespace WinForms
 
             }
         }
+
+        private void btnSetting_Click(object sender, EventArgs e)
+        {
+            Configure configureForm = new Configure();
+            configureForm.ShowDialog();
+        }
     }
 }

+ 1 - 1
WinForms/Default.resx

@@ -121,7 +121,7 @@
     <value>17, 17</value>
   </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="toolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="btnSetting.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
         YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG

+ 1 - 0
WinForms/WinForms.csproj

@@ -39,6 +39,7 @@
       <HintPath>..\Lib\HZH_Controls.dll</HintPath>
     </Reference>
     <Reference Include="System" />
+    <Reference Include="System.Configuration" />
     <Reference Include="System.Data" />
     <Reference Include="System.Deployment" />
     <Reference Include="System.Design" />