liuhao 3 年之前
父节点
当前提交
351e792231

文件差异内容过多而无法显示
+ 0 - 0
TEST_Prj/RS232两路通信程序/Demo/USER/Demo.uvguix.liuhao


+ 17 - 2
TEST_Prj/Test/Test/Form1.Designer.cs

@@ -59,6 +59,7 @@
             this.label5 = new System.Windows.Forms.Label();
             this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
             this.button2 = new System.Windows.Forms.Button();
+            this.button1 = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.bindingNavigator1)).BeginInit();
@@ -167,9 +168,9 @@
             this.btnClearAll.Location = new System.Drawing.Point(9, 373);
             this.btnClearAll.Margin = new System.Windows.Forms.Padding(2);
             this.btnClearAll.Name = "btnClearAll";
-            this.btnClearAll.Size = new System.Drawing.Size(91, 26);
+            this.btnClearAll.Size = new System.Drawing.Size(133, 36);
             this.btnClearAll.TabIndex = 3;
-            this.btnClearAll.Text = "清空数据库(&C)";
+            this.btnClearAll.Text = "清空商品数据库(&C)";
             this.btnClearAll.UseVisualStyleBackColor = true;
             this.btnClearAll.Click += new System.EventHandler(this.btnClearAll_Click);
             // 
@@ -253,6 +254,7 @@
             // 
             this.bindingNavigatorPositionItem.AccessibleName = "位置";
             this.bindingNavigatorPositionItem.AutoSize = false;
+            this.bindingNavigatorPositionItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
             this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
             this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(38, 23);
             this.bindingNavigatorPositionItem.Text = "0";
@@ -334,11 +336,23 @@
             this.button2.UseVisualStyleBackColor = true;
             this.button2.Click += new System.EventHandler(this.button2_Click);
             // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(159, 373);
+            this.button1.Margin = new System.Windows.Forms.Padding(2);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(133, 36);
+            this.button1.TabIndex = 9;
+            this.button1.Text = "清空支付数据库(&C)";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click_1);
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(772, 420);
+            this.Controls.Add(this.button1);
             this.Controls.Add(this.btnClearAll);
             this.Controls.Add(this.button2);
             this.Controls.Add(this.btnFind);
@@ -402,6 +416,7 @@
         private System.Windows.Forms.Label label5;
         private System.ComponentModel.BackgroundWorker backgroundWorker1;
         private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.Button button1;
     }
 }
 

+ 44 - 17
TEST_Prj/Test/Test/Form1.cs

@@ -45,7 +45,7 @@ namespace Test
         string user_data_tebles_sp = "user";
         string user_data_tebles_log = "log";
 
-        string server_ip = "118.190.37.99";
+        string server_ip = "39.105.214.155";
         string server_port = "3306";
         string mysql_user = "root";
         string mysql_pass = "";
@@ -276,15 +276,15 @@ namespace Test
                             Client_connect = true;
                             byte[] arrMsg = System.Text.Encoding.UTF8.GetBytes(strMsg); // 将要发送的字符串转换成Utf-8字节数组;
                             // SendMsgdata(strMsg);//源数据下发 给所有客户端
-                            foreach (Socket s in dict.Values) //开始群发信息 遍历字典里面的连接好的socket客户端  
-                            {
-                                if (s != sokClient)//判断是否是当前发送数据上来的客户端  是的话就不发送  
-                                {
-                                    s.Send(arrMsg);
-
-                                }
-                                // s.Send(arrMsg);
-                            }
+                            //foreach (Socket s in dict.Values) //开始群发信息 遍历字典里面的连接好的socket客户端  
+                            //{
+                            //    if (s != sokClient)//判断是否是当前发送数据上来的客户端  是的话就不发送  
+                            //    {
+                            //        s.Send(arrMsg);
+
+                            //    }
+                            //    // s.Send(arrMsg);
+                            //}
                             str_check(strMsg);
                             //ShowMsg("发送消息为:" + strMsg);
                         }
@@ -333,7 +333,7 @@ namespace Test
         }
         private void Form1_Load(object sender, EventArgs e)
         {
-            dataGridView1.RowHeadersVisible = false;   //隐藏首列
+           // dataGridView1.RowHeadersVisible = false;   //隐藏首列
             //String sqlConn = "server="+ server_ip + ";port=3306;user=root;password=licoo1128;database=test;Charset=utf8;";//定义连接字符串,Charset=utf8使可以填充中文字符不出现乱码
             String sqlConn = "server='" + server_ip + "';port='" + server_port + "';user='" +
                mysql_user + "';password='" + mysql_pass + "'; database='" + mysql_dataname + "';" + "Charset=utf8;";
@@ -348,7 +348,13 @@ namespace Test
                 bindingSource1.DataSource = ds.Tables[0];//绑定数据
                 bindingNavigator1.BindingSource = bindingSource1;//为导航控件绑定数据
                 dataGridView1.DataSource = bindingSource1;//为DataGridView数据控件绑定数据
+
                 dataGridView1.Columns[0].ReadOnly = true;//设置第1列,即id列不可编辑
+
+                dataGridView1.Columns[0].Width = 80;//设置列宽度
+                dataGridView1.Columns[1].Width = 120;//设置列宽度
+                dataGridView1.Columns[2].Width = 120;//设置列宽度
+                dataGridView1.Columns[3].Width = 120;//设置列宽度
             }
             catch (MySqlException ex)
             {
@@ -437,6 +443,10 @@ namespace Test
             dataGridView1.DataSource = bindingSource1;//为DataGridView数据控件绑定数据
             dataGridView1.Columns[0].ReadOnly = true;//设置第1列,即id列不可编辑
                                                      //   Console.WriteLine(bindingSource1.DataSource.ToString());
+            dataGridView1.Columns[0].Width = 80;//设置列宽度
+            dataGridView1.Columns[1].Width = 120;//设置列宽度
+            dataGridView1.Columns[2].Width = 120;//设置列宽度
+            dataGridView1.Columns[3].Width = 120;//设置列宽度
         }
 
         private void btnBulkAdd_Click(object sender, EventArgs e)
@@ -490,11 +500,11 @@ namespace Test
             else
                 MessageBox.Show("操作失败");
 
-            cmd.CommandText = string.Format("delete from " + mysql_dataname + "." + user_data_tebles_log);
-            if (cmd.ExecuteNonQuery() > 0)
-                MessageBox.Show("清空数据库成功");
-            else
-                MessageBox.Show("操作失败");
+            //cmd.CommandText = string.Format("delete from " + mysql_dataname + "." + user_data_tebles_log);
+            //if (cmd.ExecuteNonQuery() > 0)
+            //    MessageBox.Show("清空数据库成功");
+            //else
+            //    MessageBox.Show("操作失败");
 
             adapter = new MySqlDataAdapter("select * from " + user_data_tebles_sp, conn);
             DataSet ds = new DataSet();
@@ -646,6 +656,7 @@ namespace Test
                     if(datstr!="")
                     {
                         insert_data(GetCurrentTime().ToString(), datstr);
+                        SendMsgdata("server_send:Completion\r\n");//下发到下位机提示交易完成
                     }
                     
                 }
@@ -806,8 +817,24 @@ namespace Test
 
             dataGridView1.Columns[0].Width = 60;//设置列宽度
             dataGridView1.Columns[1].Width = 180;//设置列宽度
+          //  dataGridView1.Columns[3].Width = 80;//设置列宽度
+            dataGridView1.Columns[2].Width = 200;//设置列宽度
+        }
+
+        private void button1_Click_1(object sender, EventArgs e)
+        {
+            cmd.CommandText = string.Format("delete from " + mysql_dataname + "." + user_data_tebles_log);
+            if (cmd.ExecuteNonQuery() > 0)
+                MessageBox.Show("清空数据库成功");
+            else
+                MessageBox.Show("操作失败");
 
-            dataGridView1.Columns[2].Width = 100;//设置列宽度
+            adapter = new MySqlDataAdapter("select * from " + user_data_tebles_log, conn);
+            DataSet ds = new DataSet();
+            adapter.Fill(ds);//填充数据至ds数据集
+            bindingSource1.DataSource = ds.Tables[0];//绑定数据
+            bindingNavigator1.BindingSource = bindingSource1;//为导航控件绑定数据
+            dataGridView1.DataSource = bindingSource1;//为DataGridView数据控件绑定数据
         }
     }
 }

+ 2 - 0
TEST_Prj/Test/Test/Form2.Designer.cs

@@ -138,6 +138,8 @@
             this.Controls.Add(this.button1);
             this.Name = "Form2";
             this.Text = "注册界面";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form2_FormClosing);
+            this.Load += new System.EventHandler(this.Form2_Load);
             this.ResumeLayout(false);
             this.PerformLayout();
 

+ 14 - 0
TEST_Prj/Test/Test/Form2.cs

@@ -62,5 +62,19 @@ namespace Test
             this.Dispose();
             this.Close();//关闭第一个窗口
         }
+
+        private void Form2_Load(object sender, EventArgs e)
+        {
+
+        }
+
+        private void Form2_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            frmLogin f1 = new frmLogin();//Register为注册界面的name 
+            this.Hide();
+            f1.ShowDialog();
+            this.Dispose();
+            this.Close();//关闭第一个窗口
+        }
     }
 }

+ 24 - 32
TEST_Prj/Test/Test/Properties/Resources.Designer.cs

@@ -1,17 +1,17 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     此代码由工具生成。
-//     运行时版本: 4.0.30319.42000
+//     运行时版本:4.0.30319.42000
 //
 //     对此文件的更改可能会导致不正确的行为,并且如果
-//     重新生成代码,这些更改将丢失。
+//     重新生成代码,这些更改将丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace Test.Properties
-{
-
-
+namespace 超市自助付款系统管理平台.Properties {
+    using System;
+    
+    
     /// <summary>
     ///   一个强类型的资源类,用于查找本地化的字符串等。
     /// </summary>
@@ -19,51 +19,43 @@ namespace Test.Properties
     // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
     // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
     // (以 /str 作为命令选项),或重新生成 VS 项目。
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
+    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()
-        {
+        internal Resources() {
         }
-
+        
         /// <summary>
-        ///   返回此类使用的缓存的 ResourceManager 实例。
+        ///   返回此类使用的缓存的 ResourceManager 实例。
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if ((resourceMan == null))
-                {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test.Properties.Resources", typeof(Resources).Assembly);
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("超市自助付款系统管理平台.Properties.Resources", typeof(Resources).Assembly);
                     resourceMan = temp;
                 }
                 return resourceMan;
             }
         }
-
+        
         /// <summary>
-        ///   为所有资源查找重写当前线程的 CurrentUICulture 属性,
-        ///   方法是使用此强类型资源类。
+        ///   重写当前线程的 CurrentUICulture 属性,
+        ///   使用此强类型资源类的所有资源查找执行重写
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
                 return resourceCulture;
             }
-            set
-            {
+            set {
                 resourceCulture = value;
             }
         }

+ 13 - 17
TEST_Prj/Test/Test/Properties/Settings.Designer.cs

@@ -1,28 +1,24 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
 //
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace Test.Properties
-{
-
-
+namespace 超市自助付款系统管理平台.Properties {
+    
+    
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
-    {
-
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.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
-            {
+        
+        public static Settings Default {
+            get {
                 return defaultInstance;
             }
         }

+ 3 - 2
TEST_Prj/Test/Test/Test.csproj

@@ -7,8 +7,8 @@
     <ProjectGuid>{BEDBB13E-2CA5-4493-8D70-59AF5F669339}</ProjectGuid>
     <OutputType>WinExe</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Test</RootNamespace>
-    <AssemblyName>Test</AssemblyName>
+    <RootNamespace>超市自助付款系统管理平台</RootNamespace>
+    <AssemblyName>超市自助付款系统管理平台</AssemblyName>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
   </PropertyGroup>
@@ -84,6 +84,7 @@
     <Compile Include="Properties\Resources.Designer.cs">
       <AutoGen>True</AutoGen>
       <DependentUpon>Resources.resx</DependentUpon>
+      <DesignTime>True</DesignTime>
     </Compile>
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>

+ 21 - 0
TEST_Prj/Test/Test/bin/Debug/Log.txt

@@ -1145,3 +1145,24 @@
   群发完毕!!
 
 客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。
+客户端异常一个封锁操作被对 WSACancelBlockingCall 的调用中断。

二进制
TEST_Prj/Test/Test/bin/Debug/Test.exe


+ 0 - 6
TEST_Prj/Test/Test/bin/Debug/Test.exe.config

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
-    <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
-    </startup>
-</configuration>

二进制
TEST_Prj/Test/Test/bin/Debug/Test.pdb


+ 3 - 5
TEST_Prj/Test/Test/frmLogin.Designer.cs

@@ -115,7 +115,6 @@
             this.passtext.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
             this.passtext.Size = new System.Drawing.Size(270, 26);
             this.passtext.TabIndex = 24;
-            this.passtext.Text = "12345678";
             // 
             // label1
             // 
@@ -137,7 +136,6 @@
             this.nametext.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
             this.nametext.Size = new System.Drawing.Size(270, 26);
             this.nametext.TabIndex = 22;
-            this.nametext.Text = "admin";
             // 
             // label4
             // 
@@ -157,9 +155,9 @@
             this.label2.ForeColor = System.Drawing.SystemColors.ControlLightLight;
             this.label2.Location = new System.Drawing.Point(56, 38);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(148, 35);
+            this.label2.Size = new System.Drawing.Size(231, 35);
             this.label2.TabIndex = 23;
-            this.label2.Text = "X X X X";
+            this.label2.Text = "超市自助付款";
             // 
             // label3
             // 
@@ -196,7 +194,7 @@
             this.Controls.Add(this.label2);
             this.Controls.Add(this.groupBox3);
             this.Name = "frmLogin";
-            this.Text = "商品管理系统";
+            this.Text = "超市自助付款系统";
             this.Load += new System.EventHandler(this.frmLogin_Load);
             this.groupBox3.ResumeLayout(false);
             this.groupBox3.PerformLayout();

二进制
TEST_Prj/Test/Test/obj/Debug/DesignTimeResolveAssemblyReferences.cache


二进制
TEST_Prj/Test/Test/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


二进制
TEST_Prj/Test/Test/obj/Debug/Test.Properties.Resources.resources


+ 1 - 1
TEST_Prj/Test/Test/obj/Debug/Test.csproj.CoreCompileInputs.cache

@@ -1 +1 @@
-fd3bd3a9e54a9aff615bafec9df760d6e6e1e6c5
+4d81c0e4bb0fef9740a5d3266b472e970baef08a

+ 7 - 7
TEST_Prj/Test/Test/obj/Debug/Test.csproj.FileListAbsolute.txt

@@ -19,17 +19,17 @@ C:\Users\liuhao\Desktop\Test\Test\obj\Debug\Test.csproj.CoreCompileInputs.cache
 C:\Users\liuhao\Desktop\Test\Test\obj\Debug\Test.csproj.CopyComplete
 C:\Users\liuhao\Desktop\Test\Test\obj\Debug\Test.exe
 C:\Users\liuhao\Desktop\Test\Test\obj\Debug\Test.pdb
-E:\Git\TEST\TEST_Prj\Test\Test\bin\Debug\Test.exe.config
-E:\Git\TEST\TEST_Prj\Test\Test\bin\Debug\Test.exe
-E:\Git\TEST\TEST_Prj\Test\Test\bin\Debug\Test.pdb
 E:\Git\TEST\TEST_Prj\Test\Test\bin\Debug\MySql.Data.dll
 E:\Git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.Form1.resources
-E:\Git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.Properties.Resources.resources
 E:\Git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.csproj.GenerateResource.cache
 E:\Git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.csproj.CoreCompileInputs.cache
 E:\Git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.csproj.CopyComplete
-E:\Git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.exe
-E:\Git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.pdb
 E:\Git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.frmLogin.resources
 E:\Git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.Form2.resources
-E:\Git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.csprojAssemblyReference.cache
+E:\git\TEST\TEST_Prj\Test\Test\obj\Debug\Test.csproj.AssemblyReference.cache
+E:\git\TEST\TEST_Prj\Test\Test\bin\Debug\超市自助付款系统管理平台.exe.config
+E:\git\TEST\TEST_Prj\Test\Test\bin\Debug\超市自助付款系统管理平台.exe
+E:\git\TEST\TEST_Prj\Test\Test\bin\Debug\超市自助付款系统管理平台.pdb
+E:\git\TEST\TEST_Prj\Test\Test\obj\Debug\超市自助付款系统管理平台.Properties.Resources.resources
+E:\git\TEST\TEST_Prj\Test\Test\obj\Debug\超市自助付款系统管理平台.exe
+E:\git\TEST\TEST_Prj\Test\Test\obj\Debug\超市自助付款系统管理平台.pdb

二进制
TEST_Prj/Test/Test/obj/Debug/Test.csproj.GenerateResource.cache


二进制
TEST_Prj/Test/Test/obj/Debug/Test.exe


二进制
TEST_Prj/Test/Test/obj/Debug/Test.pdb


部分文件因为文件数量过多而无法显示