浏览代码

first init

张泳健 8 年前
当前提交
fa04d5e09c

+ 2 - 0
.gitignore 查看文件

1
+GWSocketClient/obj/
2
+GWSocketClient/bin/

二进制
.vs/GWSocketClient/v15/.suo 查看文件


+ 22 - 0
GWSocketClient.sln 查看文件

1
+
2
+Microsoft Visual Studio Solution File, Format Version 12.00
3
+# Visual Studio 15
4
+VisualStudioVersion = 15.0.26430.6
5
+MinimumVisualStudioVersion = 10.0.40219.1
6
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GWSocketClient", "GWSocketClient\GWSocketClient.csproj", "{1E7C256A-9CA5-4937-A5DD-7F281A2EBB21}"
7
+EndProject
8
+Global
9
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
10
+		Debug|Any CPU = Debug|Any CPU
11
+		Release|Any CPU = Release|Any CPU
12
+	EndGlobalSection
13
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
14
+		{1E7C256A-9CA5-4937-A5DD-7F281A2EBB21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15
+		{1E7C256A-9CA5-4937-A5DD-7F281A2EBB21}.Debug|Any CPU.Build.0 = Debug|Any CPU
16
+		{1E7C256A-9CA5-4937-A5DD-7F281A2EBB21}.Release|Any CPU.ActiveCfg = Release|Any CPU
17
+		{1E7C256A-9CA5-4937-A5DD-7F281A2EBB21}.Release|Any CPU.Build.0 = Release|Any CPU
18
+	EndGlobalSection
19
+	GlobalSection(SolutionProperties) = preSolution
20
+		HideSolutionNode = FALSE
21
+	EndGlobalSection
22
+EndGlobal

+ 6 - 0
GWSocketClient/App.config 查看文件

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

+ 313 - 0
GWSocketClient/Form1.Designer.cs 查看文件

1
+namespace GWSocketClient
2
+{
3
+    partial class Form1
4
+    {
5
+        /// <summary>
6
+        /// 必需的设计器变量。
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// 清理所有正在使用的资源。
12
+        /// </summary>
13
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Windows 窗体设计器生成的代码
24
+
25
+        /// <summary>
26
+        /// 设计器支持所需的方法 - 不要修改
27
+        /// 使用代码编辑器修改此方法的内容。
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
32
+            this.tbEquipmentAddress = new System.Windows.Forms.TextBox();
33
+            this.tbPort = new System.Windows.Forms.TextBox();
34
+            this.label3 = new System.Windows.Forms.Label();
35
+            this.label2 = new System.Windows.Forms.Label();
36
+            this.tbIpaddress = new System.Windows.Forms.TextBox();
37
+            this.label1 = new System.Windows.Forms.Label();
38
+            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
39
+            this.文件FToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
40
+            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
41
+            this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
42
+            this.tsslEquipmentAddress = new System.Windows.Forms.ToolStripStatusLabel();
43
+            this.btnLogin = new System.Windows.Forms.Button();
44
+            this.btnQuickLogout = new System.Windows.Forms.Button();
45
+            this.btnSendData = new System.Windows.Forms.Button();
46
+            this.tbPresureTestCount = new System.Windows.Forms.TextBox();
47
+            this.label4 = new System.Windows.Forms.Label();
48
+            this.btnPressureTest = new System.Windows.Forms.Button();
49
+            this.tbCCID = new System.Windows.Forms.TextBox();
50
+            this.label5 = new System.Windows.Forms.Label();
51
+            this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
52
+            this.tsslCCIDLEN = new System.Windows.Forms.ToolStripStatusLabel();
53
+            this.groupBox1.SuspendLayout();
54
+            this.menuStrip1.SuspendLayout();
55
+            this.statusStrip1.SuspendLayout();
56
+            this.SuspendLayout();
57
+            // 
58
+            // groupBox1
59
+            // 
60
+            this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
61
+            | System.Windows.Forms.AnchorStyles.Right)));
62
+            this.groupBox1.Controls.Add(this.tbCCID);
63
+            this.groupBox1.Controls.Add(this.label5);
64
+            this.groupBox1.Controls.Add(this.btnPressureTest);
65
+            this.groupBox1.Controls.Add(this.label4);
66
+            this.groupBox1.Controls.Add(this.tbPresureTestCount);
67
+            this.groupBox1.Controls.Add(this.btnSendData);
68
+            this.groupBox1.Controls.Add(this.btnQuickLogout);
69
+            this.groupBox1.Controls.Add(this.btnLogin);
70
+            this.groupBox1.Controls.Add(this.tbEquipmentAddress);
71
+            this.groupBox1.Controls.Add(this.tbPort);
72
+            this.groupBox1.Controls.Add(this.label3);
73
+            this.groupBox1.Controls.Add(this.label2);
74
+            this.groupBox1.Controls.Add(this.tbIpaddress);
75
+            this.groupBox1.Controls.Add(this.label1);
76
+            this.groupBox1.Location = new System.Drawing.Point(12, 28);
77
+            this.groupBox1.Name = "groupBox1";
78
+            this.groupBox1.Size = new System.Drawing.Size(883, 93);
79
+            this.groupBox1.TabIndex = 0;
80
+            this.groupBox1.TabStop = false;
81
+            this.groupBox1.Text = "groupBox1";
82
+            // 
83
+            // tbEquipmentAddress
84
+            // 
85
+            this.tbEquipmentAddress.ForeColor = System.Drawing.Color.Blue;
86
+            this.tbEquipmentAddress.Location = new System.Drawing.Point(294, 14);
87
+            this.tbEquipmentAddress.Name = "tbEquipmentAddress";
88
+            this.tbEquipmentAddress.Size = new System.Drawing.Size(123, 21);
89
+            this.tbEquipmentAddress.TabIndex = 5;
90
+            this.tbEquipmentAddress.Text = "4442832e833c";
91
+            this.tbEquipmentAddress.TextChanged += new System.EventHandler(this.tbEquipmentAddress_TextChanged);
92
+            // 
93
+            // tbPort
94
+            // 
95
+            this.tbPort.ForeColor = System.Drawing.Color.Blue;
96
+            this.tbPort.Location = new System.Drawing.Point(171, 14);
97
+            this.tbPort.Name = "tbPort";
98
+            this.tbPort.Size = new System.Drawing.Size(56, 21);
99
+            this.tbPort.TabIndex = 3;
100
+            this.tbPort.Text = "15440";
101
+            // 
102
+            // label3
103
+            // 
104
+            this.label3.AutoSize = true;
105
+            this.label3.Location = new System.Drawing.Point(234, 17);
106
+            this.label3.Name = "label3";
107
+            this.label3.Size = new System.Drawing.Size(53, 12);
108
+            this.label3.TabIndex = 4;
109
+            this.label3.Text = "设备地址";
110
+            // 
111
+            // label2
112
+            // 
113
+            this.label2.AutoSize = true;
114
+            this.label2.Location = new System.Drawing.Point(135, 17);
115
+            this.label2.Name = "label2";
116
+            this.label2.Size = new System.Drawing.Size(29, 12);
117
+            this.label2.TabIndex = 2;
118
+            this.label2.Text = "端口";
119
+            // 
120
+            // tbIpaddress
121
+            // 
122
+            this.tbIpaddress.ForeColor = System.Drawing.Color.Blue;
123
+            this.tbIpaddress.Location = new System.Drawing.Point(28, 14);
124
+            this.tbIpaddress.Name = "tbIpaddress";
125
+            this.tbIpaddress.Size = new System.Drawing.Size(100, 21);
126
+            this.tbIpaddress.TabIndex = 1;
127
+            this.tbIpaddress.Text = "127.0.0.1";
128
+            // 
129
+            // label1
130
+            // 
131
+            this.label1.AutoSize = true;
132
+            this.label1.Location = new System.Drawing.Point(4, 17);
133
+            this.label1.Name = "label1";
134
+            this.label1.Size = new System.Drawing.Size(17, 12);
135
+            this.label1.TabIndex = 0;
136
+            this.label1.Text = "IP";
137
+            // 
138
+            // menuStrip1
139
+            // 
140
+            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
141
+            this.文件FToolStripMenuItem});
142
+            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
143
+            this.menuStrip1.Name = "menuStrip1";
144
+            this.menuStrip1.Size = new System.Drawing.Size(907, 25);
145
+            this.menuStrip1.TabIndex = 1;
146
+            this.menuStrip1.Text = "menuStrip1";
147
+            // 
148
+            // 文件FToolStripMenuItem
149
+            // 
150
+            this.文件FToolStripMenuItem.Name = "文件FToolStripMenuItem";
151
+            this.文件FToolStripMenuItem.Size = new System.Drawing.Size(58, 21);
152
+            this.文件FToolStripMenuItem.Text = "文件(&F)";
153
+            // 
154
+            // statusStrip1
155
+            // 
156
+            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
157
+            this.toolStripStatusLabel1,
158
+            this.tsslEquipmentAddress,
159
+            this.toolStripStatusLabel2,
160
+            this.tsslCCIDLEN});
161
+            this.statusStrip1.Location = new System.Drawing.Point(0, 617);
162
+            this.statusStrip1.Name = "statusStrip1";
163
+            this.statusStrip1.Size = new System.Drawing.Size(907, 22);
164
+            this.statusStrip1.TabIndex = 2;
165
+            this.statusStrip1.Text = "statusStrip1";
166
+            // 
167
+            // toolStripStatusLabel1
168
+            // 
169
+            this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
170
+            this.toolStripStatusLabel1.Size = new System.Drawing.Size(56, 17);
171
+            this.toolStripStatusLabel1.Text = "设备地址";
172
+            // 
173
+            // tsslEquipmentAddress
174
+            // 
175
+            this.tsslEquipmentAddress.Name = "tsslEquipmentAddress";
176
+            this.tsslEquipmentAddress.Size = new System.Drawing.Size(25, 17);
177
+            this.tsslEquipmentAddress.Text = "6.0";
178
+            // 
179
+            // btnLogin
180
+            // 
181
+            this.btnLogin.Location = new System.Drawing.Point(6, 45);
182
+            this.btnLogin.Name = "btnLogin";
183
+            this.btnLogin.Size = new System.Drawing.Size(75, 23);
184
+            this.btnLogin.TabIndex = 3;
185
+            this.btnLogin.Text = "登录";
186
+            this.btnLogin.UseVisualStyleBackColor = true;
187
+            this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
188
+            // 
189
+            // btnQuickLogout
190
+            // 
191
+            this.btnQuickLogout.Location = new System.Drawing.Point(88, 45);
192
+            this.btnQuickLogout.Name = "btnQuickLogout";
193
+            this.btnQuickLogout.Size = new System.Drawing.Size(75, 23);
194
+            this.btnQuickLogout.TabIndex = 6;
195
+            this.btnQuickLogout.Text = "退出登录";
196
+            this.btnQuickLogout.UseVisualStyleBackColor = true;
197
+            // 
198
+            // btnSendData
199
+            // 
200
+            this.btnSendData.Location = new System.Drawing.Point(170, 45);
201
+            this.btnSendData.Name = "btnSendData";
202
+            this.btnSendData.Size = new System.Drawing.Size(75, 23);
203
+            this.btnSendData.TabIndex = 7;
204
+            this.btnSendData.Text = "发送数据";
205
+            this.btnSendData.UseVisualStyleBackColor = true;
206
+            // 
207
+            // tbPresureTestCount
208
+            // 
209
+            this.tbPresureTestCount.ForeColor = System.Drawing.Color.Blue;
210
+            this.tbPresureTestCount.Location = new System.Drawing.Point(312, 47);
211
+            this.tbPresureTestCount.Name = "tbPresureTestCount";
212
+            this.tbPresureTestCount.Size = new System.Drawing.Size(56, 21);
213
+            this.tbPresureTestCount.TabIndex = 8;
214
+            this.tbPresureTestCount.Text = "100";
215
+            // 
216
+            // label4
217
+            // 
218
+            this.label4.AutoSize = true;
219
+            this.label4.Location = new System.Drawing.Point(252, 50);
220
+            this.label4.Name = "label4";
221
+            this.label4.Size = new System.Drawing.Size(53, 12);
222
+            this.label4.TabIndex = 9;
223
+            this.label4.Text = "压力测试";
224
+            // 
225
+            // btnPressureTest
226
+            // 
227
+            this.btnPressureTest.Location = new System.Drawing.Point(375, 45);
228
+            this.btnPressureTest.Name = "btnPressureTest";
229
+            this.btnPressureTest.Size = new System.Drawing.Size(75, 23);
230
+            this.btnPressureTest.TabIndex = 10;
231
+            this.btnPressureTest.Text = "压力测试";
232
+            this.btnPressureTest.UseVisualStyleBackColor = true;
233
+            // 
234
+            // tbCCID
235
+            // 
236
+            this.tbCCID.ForeColor = System.Drawing.Color.Blue;
237
+            this.tbCCID.Location = new System.Drawing.Point(464, 14);
238
+            this.tbCCID.Name = "tbCCID";
239
+            this.tbCCID.Size = new System.Drawing.Size(294, 21);
240
+            this.tbCCID.TabIndex = 12;
241
+            this.tbCCID.Text = "3839383630324231313931353530343739383737";
242
+            this.tbCCID.TextChanged += new System.EventHandler(this.tbCCID_TextChanged);
243
+            // 
244
+            // label5
245
+            // 
246
+            this.label5.AutoSize = true;
247
+            this.label5.Location = new System.Drawing.Point(423, 17);
248
+            this.label5.Name = "label5";
249
+            this.label5.Size = new System.Drawing.Size(35, 12);
250
+            this.label5.TabIndex = 11;
251
+            this.label5.Text = "CCCID";
252
+            // 
253
+            // toolStripStatusLabel2
254
+            // 
255
+            this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
256
+            this.toolStripStatusLabel2.Size = new System.Drawing.Size(37, 17);
257
+            this.toolStripStatusLabel2.Text = "CCID";
258
+            // 
259
+            // tsslCCIDLEN
260
+            // 
261
+            this.tsslCCIDLEN.Name = "tsslCCIDLEN";
262
+            this.tsslCCIDLEN.Size = new System.Drawing.Size(32, 17);
263
+            this.tsslCCIDLEN.Text = "20.0";
264
+            // 
265
+            // Form1
266
+            // 
267
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
268
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
269
+            this.ClientSize = new System.Drawing.Size(907, 639);
270
+            this.Controls.Add(this.statusStrip1);
271
+            this.Controls.Add(this.groupBox1);
272
+            this.Controls.Add(this.menuStrip1);
273
+            this.Name = "Form1";
274
+            this.Text = "Form1";
275
+            this.Load += new System.EventHandler(this.Form1_Load);
276
+            this.groupBox1.ResumeLayout(false);
277
+            this.groupBox1.PerformLayout();
278
+            this.menuStrip1.ResumeLayout(false);
279
+            this.menuStrip1.PerformLayout();
280
+            this.statusStrip1.ResumeLayout(false);
281
+            this.statusStrip1.PerformLayout();
282
+            this.ResumeLayout(false);
283
+            this.PerformLayout();
284
+
285
+        }
286
+
287
+        #endregion
288
+
289
+        private System.Windows.Forms.GroupBox groupBox1;
290
+        private System.Windows.Forms.TextBox tbEquipmentAddress;
291
+        private System.Windows.Forms.TextBox tbPort;
292
+        private System.Windows.Forms.Label label3;
293
+        private System.Windows.Forms.Label label2;
294
+        private System.Windows.Forms.TextBox tbIpaddress;
295
+        private System.Windows.Forms.Label label1;
296
+        private System.Windows.Forms.MenuStrip menuStrip1;
297
+        private System.Windows.Forms.ToolStripMenuItem 文件FToolStripMenuItem;
298
+        private System.Windows.Forms.StatusStrip statusStrip1;
299
+        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
300
+        private System.Windows.Forms.ToolStripStatusLabel tsslEquipmentAddress;
301
+        private System.Windows.Forms.Button btnPressureTest;
302
+        private System.Windows.Forms.Label label4;
303
+        private System.Windows.Forms.TextBox tbPresureTestCount;
304
+        private System.Windows.Forms.Button btnSendData;
305
+        private System.Windows.Forms.Button btnQuickLogout;
306
+        private System.Windows.Forms.Button btnLogin;
307
+        private System.Windows.Forms.TextBox tbCCID;
308
+        private System.Windows.Forms.Label label5;
309
+        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2;
310
+        private System.Windows.Forms.ToolStripStatusLabel tsslCCIDLEN;
311
+    }
312
+}
313
+

+ 73 - 0
GWSocketClient/Form1.cs 查看文件

1
+using System;
2
+using System.Collections.Generic;
3
+using System.ComponentModel;
4
+using System.Data;
5
+using System.Drawing;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+using System.Windows.Forms;
10
+using XuanJiSocket;
11
+
12
+
13
+namespace GWSocketClient
14
+{
15
+    public partial class Form1 : Form
16
+    {
17
+        public Form1()
18
+        {
19
+            InitializeComponent();
20
+        }
21
+
22
+        private string ip;
23
+        private string port;
24
+        private SocketHelper.TcpClients sockeTcpClients;
25
+
26
+        private void Form1_Load(object sender, EventArgs e)
27
+        {
28
+            SocketHelper.pushSockets = new SocketHelper.PushSockets(receiveData); //注册推送器
29
+            sockeTcpClients = new SocketHelper.TcpClients();
30
+            ip = tbIpaddress.Text.Trim();
31
+            port = tbPort.Text.Trim();
32
+        }
33
+
34
+        private void receiveData(SocketHelper.Sockets sks)
35
+        {
36
+        }
37
+
38
+        private void tbEquipmentAddress_TextChanged(object sender, EventArgs e)
39
+        {
40
+            string equipmentAddress = tbEquipmentAddress.Text.Trim();
41
+
42
+            tsslEquipmentAddress.Text = equipmentAddress.Length / 2.0 + "";
43
+        }
44
+
45
+        private void btnLogin_Click(object sender, EventArgs e)
46
+        {
47
+            try
48
+            {
49
+                ip = tbIpaddress.Text.Trim();
50
+                port = tbPort.Text.Trim();
51
+
52
+                sockeTcpClients.InitSocket(ip, int.Parse(port));
53
+                sockeTcpClients.Start();
54
+
55
+                
56
+            }
57
+            catch (Exception ex)
58
+            {
59
+//                statuslist.Items.Add(string.Format("连接失败!原因:{0}", ex.Message));
60
+
61
+                btnLogin.Enabled = true;
62
+            }
63
+        }
64
+
65
+        private void tbCCID_TextChanged(object sender, EventArgs e)
66
+        {
67
+            
68
+            string ccid = tbCCID.Text.Trim();
69
+
70
+            tsslCCIDLEN.Text = ccid.Length / 2.0 + "";
71
+        }
72
+    }
73
+}

+ 126 - 0
GWSocketClient/Form1.resx 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+  <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
+    <value>17, 17</value>
122
+  </metadata>
123
+  <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124
+    <value>137, 17</value>
125
+  </metadata>
126
+</root>

+ 86 - 0
GWSocketClient/GWSocketClient.csproj 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{1E7C256A-9CA5-4937-A5DD-7F281A2EBB21}</ProjectGuid>
8
+    <OutputType>WinExe</OutputType>
9
+    <RootNamespace>GWSocketClient</RootNamespace>
10
+    <AssemblyName>GWSocketClient</AssemblyName>
11
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
12
+    <FileAlignment>512</FileAlignment>
13
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14
+  </PropertyGroup>
15
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16
+    <PlatformTarget>AnyCPU</PlatformTarget>
17
+    <DebugSymbols>true</DebugSymbols>
18
+    <DebugType>full</DebugType>
19
+    <Optimize>false</Optimize>
20
+    <OutputPath>bin\Debug\</OutputPath>
21
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
22
+    <ErrorReport>prompt</ErrorReport>
23
+    <WarningLevel>4</WarningLevel>
24
+  </PropertyGroup>
25
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26
+    <PlatformTarget>AnyCPU</PlatformTarget>
27
+    <DebugType>pdbonly</DebugType>
28
+    <Optimize>true</Optimize>
29
+    <OutputPath>bin\Release\</OutputPath>
30
+    <DefineConstants>TRACE</DefineConstants>
31
+    <ErrorReport>prompt</ErrorReport>
32
+    <WarningLevel>4</WarningLevel>
33
+  </PropertyGroup>
34
+  <ItemGroup>
35
+    <Reference Include="System" />
36
+    <Reference Include="System.Core" />
37
+    <Reference Include="System.Xml.Linq" />
38
+    <Reference Include="System.Data.DataSetExtensions" />
39
+    <Reference Include="Microsoft.CSharp" />
40
+    <Reference Include="System.Data" />
41
+    <Reference Include="System.Deployment" />
42
+    <Reference Include="System.Drawing" />
43
+    <Reference Include="System.Net.Http" />
44
+    <Reference Include="System.Windows.Forms" />
45
+    <Reference Include="System.Xml" />
46
+    <Reference Include="XuanJiSocket">
47
+      <HintPath>dlls\XuanJiSocket.dll</HintPath>
48
+    </Reference>
49
+  </ItemGroup>
50
+  <ItemGroup>
51
+    <Compile Include="Form1.cs">
52
+      <SubType>Form</SubType>
53
+    </Compile>
54
+    <Compile Include="Form1.Designer.cs">
55
+      <DependentUpon>Form1.cs</DependentUpon>
56
+    </Compile>
57
+    <Compile Include="Program.cs" />
58
+    <Compile Include="Properties\AssemblyInfo.cs" />
59
+    <Compile Include="util\CheckUtil.cs" />
60
+    <EmbeddedResource Include="Form1.resx">
61
+      <DependentUpon>Form1.cs</DependentUpon>
62
+    </EmbeddedResource>
63
+    <EmbeddedResource Include="Properties\Resources.resx">
64
+      <Generator>ResXFileCodeGenerator</Generator>
65
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
66
+      <SubType>Designer</SubType>
67
+    </EmbeddedResource>
68
+    <Compile Include="Properties\Resources.Designer.cs">
69
+      <AutoGen>True</AutoGen>
70
+      <DependentUpon>Resources.resx</DependentUpon>
71
+    </Compile>
72
+    <None Include="Properties\Settings.settings">
73
+      <Generator>SettingsSingleFileGenerator</Generator>
74
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
75
+    </None>
76
+    <Compile Include="Properties\Settings.Designer.cs">
77
+      <AutoGen>True</AutoGen>
78
+      <DependentUpon>Settings.settings</DependentUpon>
79
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
80
+    </Compile>
81
+  </ItemGroup>
82
+  <ItemGroup>
83
+    <None Include="App.config" />
84
+  </ItemGroup>
85
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
86
+</Project>

+ 22 - 0
GWSocketClient/Program.cs 查看文件

1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+using System.Windows.Forms;
6
+
7
+namespace GWSocketClient
8
+{
9
+    static class Program
10
+    {
11
+        /// <summary>
12
+        /// 应用程序的主入口点。
13
+        /// </summary>
14
+        [STAThread]
15
+        static void Main()
16
+        {
17
+            Application.EnableVisualStyles();
18
+            Application.SetCompatibleTextRenderingDefault(false);
19
+            Application.Run(new Form1());
20
+        }
21
+    }
22
+}

+ 36 - 0
GWSocketClient/Properties/AssemblyInfo.cs 查看文件

1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// 有关程序集的一般信息由以下
6
+// 控制。更改这些特性值可修改
7
+// 与程序集关联的信息。
8
+[assembly: AssemblyTitle("GWSocketClient")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("Microsoft")]
12
+[assembly: AssemblyProduct("GWSocketClient")]
13
+[assembly: AssemblyCopyright("Copyright © Microsoft 2017")]
14
+[assembly: AssemblyTrademark("")]
15
+[assembly: AssemblyCulture("")]
16
+
17
+// 将 ComVisible 设置为 false 会使此程序集中的类型
18
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19
+//请将此类型的 ComVisible 特性设置为 true。
20
+[assembly: ComVisible(false)]
21
+
22
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23
+[assembly: Guid("1e7c256a-9ca5-4937-a5dd-7f281a2ebb21")]
24
+
25
+// 程序集的版本信息由下列四个值组成: 
26
+//
27
+//      主版本
28
+//      次版本
29
+//      生成号
30
+//      修订号
31
+//
32
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
33
+// 方法是按如下所示使用“*”: :
34
+// [assembly: AssemblyVersion("1.0.*")]
35
+[assembly: AssemblyVersion("1.0.0.0")]
36
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71 - 0
GWSocketClient/Properties/Resources.Designer.cs 查看文件

1
+//------------------------------------------------------------------------------
2
+// <auto-generated>
3
+//     此代码由工具生成。
4
+//     运行时版本: 4.0.30319.42000
5
+//
6
+//     对此文件的更改可能导致不正确的行为,如果
7
+//     重新生成代码,则所做更改将丢失。
8
+// </auto-generated>
9
+//------------------------------------------------------------------------------
10
+
11
+namespace GWSocketClient.Properties
12
+{
13
+
14
+
15
+    /// <summary>
16
+    ///   强类型资源类,用于查找本地化字符串等。
17
+    /// </summary>
18
+    // 此类是由 StronglyTypedResourceBuilder
19
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
22
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25
+    internal class Resources
26
+    {
27
+
28
+        private static global::System.Resources.ResourceManager resourceMan;
29
+
30
+        private static global::System.Globalization.CultureInfo resourceCulture;
31
+
32
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33
+        internal Resources()
34
+        {
35
+        }
36
+
37
+        /// <summary>
38
+        ///   返回此类使用的缓存 ResourceManager 实例。
39
+        /// </summary>
40
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41
+        internal static global::System.Resources.ResourceManager ResourceManager
42
+        {
43
+            get
44
+            {
45
+                if ((resourceMan == null))
46
+                {
47
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GWSocketClient.Properties.Resources", typeof(Resources).Assembly);
48
+                    resourceMan = temp;
49
+                }
50
+                return resourceMan;
51
+            }
52
+        }
53
+
54
+        /// <summary>
55
+        ///   覆盖当前线程的 CurrentUICulture 属性
56
+        ///   使用此强类型的资源类的资源查找。
57
+        /// </summary>
58
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59
+        internal static global::System.Globalization.CultureInfo Culture
60
+        {
61
+            get
62
+            {
63
+                return resourceCulture;
64
+            }
65
+            set
66
+            {
67
+                resourceCulture = value;
68
+            }
69
+        }
70
+    }
71
+}

+ 117 - 0
GWSocketClient/Properties/Resources.resx 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:element name="root" msdata:IsDataSet="true">
64
+      <xsd:complexType>
65
+        <xsd:choice maxOccurs="unbounded">
66
+          <xsd:element name="metadata">
67
+            <xsd:complexType>
68
+              <xsd:sequence>
69
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
70
+              </xsd:sequence>
71
+              <xsd:attribute name="name" type="xsd:string" />
72
+              <xsd:attribute name="type" type="xsd:string" />
73
+              <xsd:attribute name="mimetype" type="xsd:string" />
74
+            </xsd:complexType>
75
+          </xsd:element>
76
+          <xsd:element name="assembly">
77
+            <xsd:complexType>
78
+              <xsd:attribute name="alias" type="xsd:string" />
79
+              <xsd:attribute name="name" type="xsd:string" />
80
+            </xsd:complexType>
81
+          </xsd:element>
82
+          <xsd:element name="data">
83
+            <xsd:complexType>
84
+              <xsd:sequence>
85
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
86
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
87
+              </xsd:sequence>
88
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
89
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
90
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
91
+            </xsd:complexType>
92
+          </xsd:element>
93
+          <xsd:element name="resheader">
94
+            <xsd:complexType>
95
+              <xsd:sequence>
96
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
97
+              </xsd:sequence>
98
+              <xsd:attribute name="name" type="xsd:string" use="required" />
99
+            </xsd:complexType>
100
+          </xsd:element>
101
+        </xsd:choice>
102
+      </xsd:complexType>
103
+    </xsd:element>
104
+  </xsd:schema>
105
+  <resheader name="resmimetype">
106
+    <value>text/microsoft-resx</value>
107
+  </resheader>
108
+  <resheader name="version">
109
+    <value>2.0</value>
110
+  </resheader>
111
+  <resheader name="reader">
112
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
113
+  </resheader>
114
+  <resheader name="writer">
115
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+</root>

+ 30 - 0
GWSocketClient/Properties/Settings.Designer.cs 查看文件

1
+//------------------------------------------------------------------------------
2
+// <auto-generated>
3
+//     This code was generated by a tool.
4
+//     Runtime Version:4.0.30319.42000
5
+//
6
+//     Changes to this file may cause incorrect behavior and will be lost if
7
+//     the code is regenerated.
8
+// </auto-generated>
9
+//------------------------------------------------------------------------------
10
+
11
+namespace GWSocketClient.Properties
12
+{
13
+
14
+
15
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18
+    {
19
+
20
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21
+
22
+        public static Settings Default
23
+        {
24
+            get
25
+            {
26
+                return defaultInstance;
27
+            }
28
+        }
29
+    }
30
+}

+ 7 - 0
GWSocketClient/Properties/Settings.settings 查看文件

1
+<?xml version='1.0' encoding='utf-8'?>
2
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
3
+  <Profiles>
4
+    <Profile Name="(Default)" />
5
+  </Profiles>
6
+  <Settings />
7
+</SettingsFile>

二进制
GWSocketClient/dlls/XuanJiSocket.dll 查看文件


+ 15 - 0
GWSocketClient/util/CheckUtil.cs 查看文件

1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace GWSocketClient.util
8
+{
9
+    class CheckUtil
10
+    {
11
+
12
+
13
+
14
+    }
15
+}

+ 2 - 0
README.md 查看文件

1
+
2
+# C#