张泳健 il y a 7 ans
révision
4d26f025f3

+ 13 - 0
.gitignore Voir le fichier

@@ -0,0 +1,13 @@
1
+.vs/*
2
+packages/*
3
+DotNettyFromTests/obj/*
4
+DotNettyFromTests/bin/*
5
+
6
+DotNettyFrom/obj/*
7
+DotNettyFrom/bin/*
8
+
9
+TestServerTests/obj/*
10
+TestServerTests/bin/*
11
+
12
+TestServer/obj/*
13
+TestServer/bin/*

+ 31 - 0
DotNettyFrom.sln Voir le fichier

@@ -0,0 +1,31 @@
1
+
2
+Microsoft Visual Studio Solution File, Format Version 12.00
3
+# Visual Studio 15
4
+VisualStudioVersion = 15.0.26730.12
5
+MinimumVisualStudioVersion = 10.0.40219.1
6
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNettyFrom", "DotNettyFrom\DotNettyFrom.csproj", "{2348CBA6-AD06-457D-9F0C-06BFB0F432CE}"
7
+EndProject
8
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestServer", "TestServer\TestServer.csproj", "{4ED061B5-251E-4813-ABAD-4B6B57A4FC67}"
9
+EndProject
10
+Global
11
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
12
+		Debug|Any CPU = Debug|Any CPU
13
+		Release|Any CPU = Release|Any CPU
14
+	EndGlobalSection
15
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
16
+		{2348CBA6-AD06-457D-9F0C-06BFB0F432CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17
+		{2348CBA6-AD06-457D-9F0C-06BFB0F432CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
18
+		{2348CBA6-AD06-457D-9F0C-06BFB0F432CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
19
+		{2348CBA6-AD06-457D-9F0C-06BFB0F432CE}.Release|Any CPU.Build.0 = Release|Any CPU
20
+		{4ED061B5-251E-4813-ABAD-4B6B57A4FC67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21
+		{4ED061B5-251E-4813-ABAD-4B6B57A4FC67}.Debug|Any CPU.Build.0 = Debug|Any CPU
22
+		{4ED061B5-251E-4813-ABAD-4B6B57A4FC67}.Release|Any CPU.ActiveCfg = Release|Any CPU
23
+		{4ED061B5-251E-4813-ABAD-4B6B57A4FC67}.Release|Any CPU.Build.0 = Release|Any CPU
24
+	EndGlobalSection
25
+	GlobalSection(SolutionProperties) = preSolution
26
+		HideSolutionNode = FALSE
27
+	EndGlobalSection
28
+	GlobalSection(ExtensibilityGlobals) = postSolution
29
+		SolutionGuid = {821ACA80-FE1D-4121-9926-3F3C26A60905}
30
+	EndGlobalSection
31
+EndGlobal

+ 14 - 0
DotNettyFrom/App.config Voir le fichier

@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<configuration>
3
+    <startup> 
4
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5
+    </startup>
6
+  <runtime>
7
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8
+      <dependentAssembly>
9
+        <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
10
+        <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
11
+      </dependentAssembly>
12
+    </assemblyBinding>
13
+  </runtime>
14
+</configuration>

+ 170 - 0
DotNettyFrom/DotNettyFrom.csproj Voir le fichier

@@ -0,0 +1,170 @@
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>{2348CBA6-AD06-457D-9F0C-06BFB0F432CE}</ProjectGuid>
8
+    <OutputType>Exe</OutputType>
9
+    <RootNamespace>DotNettyFrom</RootNamespace>
10
+    <AssemblyName>DotNettyFrom</AssemblyName>
11
+    <TargetFrameworkVersion>v4.6.1</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
+  <PropertyGroup>
35
+    <StartupObject />
36
+  </PropertyGroup>
37
+  <ItemGroup>
38
+    <Reference Include="DotNetty.Buffers, Version=0.4.6.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
39
+      <HintPath>..\packages\DotNetty.Buffers.0.4.6\lib\net45\DotNetty.Buffers.dll</HintPath>
40
+    </Reference>
41
+    <Reference Include="DotNetty.Codecs, Version=0.4.6.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
42
+      <HintPath>..\packages\DotNetty.Codecs.0.4.6\lib\net45\DotNetty.Codecs.dll</HintPath>
43
+    </Reference>
44
+    <Reference Include="DotNetty.Common, Version=0.4.6.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
45
+      <HintPath>..\packages\DotNetty.Common.0.4.6\lib\net45\DotNetty.Common.dll</HintPath>
46
+    </Reference>
47
+    <Reference Include="DotNetty.Handlers, Version=0.4.6.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
48
+      <HintPath>..\packages\DotNetty.Handlers.0.4.6\lib\net45\DotNetty.Handlers.dll</HintPath>
49
+    </Reference>
50
+    <Reference Include="DotNetty.Transport, Version=0.4.6.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
51
+      <HintPath>..\packages\DotNetty.Transport.0.4.6\lib\net45\DotNetty.Transport.dll</HintPath>
52
+    </Reference>
53
+    <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
54
+      <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.1.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
55
+    </Reference>
56
+    <Reference Include="Microsoft.Extensions.Logging, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
57
+      <HintPath>..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll</HintPath>
58
+    </Reference>
59
+    <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
60
+      <HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
61
+    </Reference>
62
+    <Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
63
+      <HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
64
+    </Reference>
65
+    <Reference Include="System" />
66
+    <Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
67
+      <HintPath>..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll</HintPath>
68
+    </Reference>
69
+    <Reference Include="System.ComponentModel.Composition" />
70
+    <Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
71
+      <HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
72
+    </Reference>
73
+    <Reference Include="System.Core" />
74
+    <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
75
+      <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
76
+    </Reference>
77
+    <Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
78
+      <HintPath>..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll</HintPath>
79
+    </Reference>
80
+    <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
81
+      <HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
82
+      <Private>True</Private>
83
+    </Reference>
84
+    <Reference Include="System.IO.Compression.FileSystem" />
85
+    <Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
86
+      <HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
87
+    </Reference>
88
+    <Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
89
+      <HintPath>..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath>
90
+    </Reference>
91
+    <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
92
+      <HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
93
+    </Reference>
94
+    <Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
95
+      <HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
96
+    </Reference>
97
+    <Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
98
+      <HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
99
+    </Reference>
100
+    <Reference Include="System.Numerics" />
101
+    <Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
102
+      <HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
103
+      <Private>True</Private>
104
+    </Reference>
105
+    <Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
106
+      <HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
107
+    </Reference>
108
+    <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
109
+      <HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
110
+    </Reference>
111
+    <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
112
+      <HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
113
+    </Reference>
114
+    <Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
115
+      <HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
116
+    </Reference>
117
+    <Reference Include="System.Xml.Linq" />
118
+    <Reference Include="System.Data.DataSetExtensions" />
119
+    <Reference Include="Microsoft.CSharp" />
120
+    <Reference Include="System.Data" />
121
+    <Reference Include="System.Deployment" />
122
+    <Reference Include="System.Drawing" />
123
+    <Reference Include="System.Windows.Forms" />
124
+    <Reference Include="System.Xml" />
125
+    <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
126
+      <HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath>
127
+    </Reference>
128
+  </ItemGroup>
129
+  <ItemGroup>
130
+    <Compile Include="common\DataModel.cs" />
131
+    <Compile Include="common\UIInfoModel..cs" />
132
+    <Compile Include="config\SystemConfig.cs" />
133
+    <Compile Include="Form1.cs">
134
+      <SubType>Form</SubType>
135
+    </Compile>
136
+    <Compile Include="Form1.Designer.cs">
137
+      <DependentUpon>Form1.cs</DependentUpon>
138
+    </Compile>
139
+    <Compile Include="netty\NettyClient.cs" />
140
+    <Compile Include="Program.cs" />
141
+    <Compile Include="Properties\AssemblyInfo.cs" />
142
+    <EmbeddedResource Include="Form1.resx">
143
+      <DependentUpon>Form1.cs</DependentUpon>
144
+    </EmbeddedResource>
145
+    <EmbeddedResource Include="Properties\Resources.resx">
146
+      <Generator>ResXFileCodeGenerator</Generator>
147
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
148
+      <SubType>Designer</SubType>
149
+    </EmbeddedResource>
150
+    <Compile Include="Properties\Resources.Designer.cs">
151
+      <AutoGen>True</AutoGen>
152
+      <DependentUpon>Resources.resx</DependentUpon>
153
+    </Compile>
154
+    <None Include="packages.config" />
155
+    <None Include="Properties\Settings.settings">
156
+      <Generator>SettingsSingleFileGenerator</Generator>
157
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
158
+    </None>
159
+    <Compile Include="Properties\Settings.Designer.cs">
160
+      <AutoGen>True</AutoGen>
161
+      <DependentUpon>Settings.settings</DependentUpon>
162
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
163
+    </Compile>
164
+  </ItemGroup>
165
+  <ItemGroup>
166
+    <None Include="App.config" />
167
+  </ItemGroup>
168
+  <ItemGroup />
169
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
170
+</Project>

+ 171 - 0
DotNettyFrom/Form1.Designer.cs Voir le fichier

@@ -0,0 +1,171 @@
1
+namespace DotNettyFrom
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.listBox1 = new System.Windows.Forms.ListBox();
32
+            this.TbHost = new System.Windows.Forms.TextBox();
33
+            this.TbPort = new System.Windows.Forms.TextBox();
34
+            this.BtnConnection = new System.Windows.Forms.Button();
35
+            this.BtnDisConn = new System.Windows.Forms.Button();
36
+            this.BtnLogin = new System.Windows.Forms.Button();
37
+            this.BtnSendData = new System.Windows.Forms.Button();
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.menuStrip1.SuspendLayout();
42
+            this.SuspendLayout();
43
+            // 
44
+            // listBox1
45
+            // 
46
+            this.listBox1.FormattingEnabled = true;
47
+            this.listBox1.ItemHeight = 12;
48
+            this.listBox1.Location = new System.Drawing.Point(12, 60);
49
+            this.listBox1.Name = "listBox1";
50
+            this.listBox1.Size = new System.Drawing.Size(820, 436);
51
+            this.listBox1.TabIndex = 0;
52
+            // 
53
+            // TbHost
54
+            // 
55
+            this.TbHost.Location = new System.Drawing.Point(39, 23);
56
+            this.TbHost.Name = "TbHost";
57
+            this.TbHost.Size = new System.Drawing.Size(241, 21);
58
+            this.TbHost.TabIndex = 1;
59
+            this.TbHost.Text = "127.0.0.1";
60
+            // 
61
+            // TbPort
62
+            // 
63
+            this.TbPort.Location = new System.Drawing.Point(286, 23);
64
+            this.TbPort.Name = "TbPort";
65
+            this.TbPort.Size = new System.Drawing.Size(72, 21);
66
+            this.TbPort.TabIndex = 1;
67
+            this.TbPort.Text = "4001";
68
+            // 
69
+            // BtnConnection
70
+            // 
71
+            this.BtnConnection.Location = new System.Drawing.Point(364, 23);
72
+            this.BtnConnection.Name = "BtnConnection";
73
+            this.BtnConnection.Size = new System.Drawing.Size(75, 23);
74
+            this.BtnConnection.TabIndex = 2;
75
+            this.BtnConnection.Text = "连接";
76
+            this.BtnConnection.UseVisualStyleBackColor = true;
77
+            this.BtnConnection.Click += new System.EventHandler(this.BtnConnection_Click);
78
+            // 
79
+            // BtnDisConn
80
+            // 
81
+            this.BtnDisConn.Location = new System.Drawing.Point(445, 23);
82
+            this.BtnDisConn.Name = "BtnDisConn";
83
+            this.BtnDisConn.Size = new System.Drawing.Size(75, 23);
84
+            this.BtnDisConn.TabIndex = 2;
85
+            this.BtnDisConn.Text = "断开";
86
+            this.BtnDisConn.UseVisualStyleBackColor = true;
87
+            this.BtnDisConn.Click += new System.EventHandler(this.BtnDisConn_Click);
88
+            // 
89
+            // BtnLogin
90
+            // 
91
+            this.BtnLogin.Location = new System.Drawing.Point(526, 23);
92
+            this.BtnLogin.Name = "BtnLogin";
93
+            this.BtnLogin.Size = new System.Drawing.Size(75, 23);
94
+            this.BtnLogin.TabIndex = 2;
95
+            this.BtnLogin.Text = "登录";
96
+            this.BtnLogin.UseVisualStyleBackColor = true;
97
+            // 
98
+            // BtnSendData
99
+            // 
100
+            this.BtnSendData.Location = new System.Drawing.Point(607, 23);
101
+            this.BtnSendData.Name = "BtnSendData";
102
+            this.BtnSendData.Size = new System.Drawing.Size(75, 23);
103
+            this.BtnSendData.TabIndex = 2;
104
+            this.BtnSendData.Text = "发送数据";
105
+            this.BtnSendData.UseVisualStyleBackColor = true;
106
+            this.BtnSendData.Click += new System.EventHandler(this.BtnSendData_Click);
107
+            // 
108
+            // menuStrip1
109
+            // 
110
+            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
111
+            this.文件FToolStripMenuItem});
112
+            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
113
+            this.menuStrip1.Name = "menuStrip1";
114
+            this.menuStrip1.Size = new System.Drawing.Size(844, 25);
115
+            this.menuStrip1.TabIndex = 3;
116
+            this.menuStrip1.Text = "menuStrip1";
117
+            // 
118
+            // 文件FToolStripMenuItem
119
+            // 
120
+            this.文件FToolStripMenuItem.Name = "文件FToolStripMenuItem";
121
+            this.文件FToolStripMenuItem.Size = new System.Drawing.Size(58, 21);
122
+            this.文件FToolStripMenuItem.Text = "文件(&F)";
123
+            // 
124
+            // statusStrip1
125
+            // 
126
+            this.statusStrip1.Location = new System.Drawing.Point(0, 508);
127
+            this.statusStrip1.Name = "statusStrip1";
128
+            this.statusStrip1.Size = new System.Drawing.Size(844, 22);
129
+            this.statusStrip1.TabIndex = 4;
130
+            this.statusStrip1.Text = "statusStrip1";
131
+            // 
132
+            // Form1
133
+            // 
134
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
135
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
136
+            this.ClientSize = new System.Drawing.Size(844, 530);
137
+            this.Controls.Add(this.statusStrip1);
138
+            this.Controls.Add(this.BtnDisConn);
139
+            this.Controls.Add(this.BtnSendData);
140
+            this.Controls.Add(this.BtnLogin);
141
+            this.Controls.Add(this.BtnConnection);
142
+            this.Controls.Add(this.TbPort);
143
+            this.Controls.Add(this.TbHost);
144
+            this.Controls.Add(this.listBox1);
145
+            this.Controls.Add(this.menuStrip1);
146
+            this.MainMenuStrip = this.menuStrip1;
147
+            this.Name = "Form1";
148
+            this.Text = "Form1";
149
+            this.Load += new System.EventHandler(this.Form1_Load);
150
+            this.menuStrip1.ResumeLayout(false);
151
+            this.menuStrip1.PerformLayout();
152
+            this.ResumeLayout(false);
153
+            this.PerformLayout();
154
+
155
+        }
156
+
157
+        #endregion
158
+
159
+        private System.Windows.Forms.ListBox listBox1;
160
+        private System.Windows.Forms.TextBox TbHost;
161
+        private System.Windows.Forms.TextBox TbPort;
162
+        private System.Windows.Forms.Button BtnConnection;
163
+        private System.Windows.Forms.Button BtnDisConn;
164
+        private System.Windows.Forms.Button BtnLogin;
165
+        private System.Windows.Forms.Button BtnSendData;
166
+        private System.Windows.Forms.MenuStrip menuStrip1;
167
+        private System.Windows.Forms.ToolStripMenuItem 文件FToolStripMenuItem;
168
+        private System.Windows.Forms.StatusStrip statusStrip1;
169
+    }
170
+}
171
+

+ 64 - 0
DotNettyFrom/Form1.cs Voir le fichier

@@ -0,0 +1,64 @@
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;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+using DotNettyFrom.common;
12
+using DotNettyFrom.netty;
13
+
14
+namespace DotNettyFrom
15
+{
16
+    public partial class Form1 : Form
17
+    {
18
+        public Form1()
19
+        {
20
+            InitializeComponent();
21
+        }
22
+
23
+        private NettyClient nc;
24
+        private Thread t;
25
+        private void BtnConnection_Click(object sender, EventArgs e)
26
+        {
27
+            /* var producer = Task.Factory.StartNew(() =>
28
+             {
29
+                 for (int count = 0; count < 1000; count++)
30
+                 {
31
+
32
+
33
+                 }
34
+                 //                blockingCollection.CompleteAdding();
35
+             });*/
36
+            nc = new NettyClient();
37
+            t = new Thread(() => { nc.StartNetty("127.0.0.1", 4001); });
38
+            t.Start();
39
+
40
+        }
41
+
42
+        private void Form1_Load(object sender, EventArgs e)
43
+        {
44
+            var consumer = Task.Factory.StartNew(() =>
45
+            {
46
+                foreach (UIInfoModel value in DataModel.ReceCollection.GetConsumingEnumerable())
47
+                {
48
+                    Invoke(new ThreadStart(delegate { listBox1.Items.Add(value); }));
49
+                }
50
+            });
51
+        }
52
+
53
+        private void BtnDisConn_Click(object sender, EventArgs e)
54
+        {
55
+            nc.StopNetty();
56
+            t.Abort();
57
+        }
58
+
59
+        private void BtnSendData_Click(object sender, EventArgs e)
60
+        {
61
+            nc.SendData("");
62
+        }
63
+    }
64
+}

+ 126 - 0
DotNettyFrom/Form1.resx Voir le fichier

@@ -0,0 +1,126 @@
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>

+ 22 - 0
DotNettyFrom/Program.cs Voir le fichier

@@ -0,0 +1,22 @@
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 DotNettyFrom
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
DotNettyFrom/Properties/AssemblyInfo.cs Voir le fichier

@@ -0,0 +1,36 @@
1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// 有关程序集的一般信息由以下
6
+// 控制。更改这些特性值可修改
7
+// 与程序集关联的信息。
8
+[assembly: AssemblyTitle("DotNettyFrom")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("")]
12
+[assembly: AssemblyProduct("DotNettyFrom")]
13
+[assembly: AssemblyCopyright("Copyright ©  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("2348cba6-ad06-457d-9f0c-06bfb0f432ce")]
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
DotNettyFrom/Properties/Resources.Designer.cs Voir le fichier

@@ -0,0 +1,71 @@
1
+//------------------------------------------------------------------------------
2
+// <auto-generated>
3
+//     此代码由工具生成。
4
+//     运行时版本: 4.0.30319.42000
5
+//
6
+//     对此文件的更改可能导致不正确的行为,如果
7
+//     重新生成代码,则所做更改将丢失。
8
+// </auto-generated>
9
+//------------------------------------------------------------------------------
10
+
11
+namespace DotNettyFrom.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("DotNettyFrom.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
DotNettyFrom/Properties/Resources.resx Voir le fichier

@@ -0,0 +1,117 @@
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
DotNettyFrom/Properties/Settings.Designer.cs Voir le fichier

@@ -0,0 +1,30 @@
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 DotNettyFrom.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
DotNettyFrom/Properties/Settings.settings Voir le fichier

@@ -0,0 +1,7 @@
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>

+ 14 - 0
DotNettyFrom/common/DataModel.cs Voir le fichier

@@ -0,0 +1,14 @@
1
+using System;
2
+using System.Collections.Concurrent;
3
+using System.Collections.Generic;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace DotNettyFrom.common
9
+{
10
+    public class DataModel
11
+    {
12
+        public static  BlockingCollection<UIInfoModel> ReceCollection = new BlockingCollection<UIInfoModel>();
13
+    }
14
+}

+ 77 - 0
DotNettyFrom/common/UIInfoModel..cs Voir le fichier

@@ -0,0 +1,77 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using DotNettyFrom.config;
7
+
8
+namespace DotNettyFrom.common
9
+{
10
+    [Serializable]
11
+    public class UIInfoModel
12
+    {
13
+        public int action = -1;
14
+        public DateTime time = DateTime.Now;
15
+        public string info = "";
16
+
17
+        public string cmd = "";
18
+
19
+        //true 发送的. false:接收的
20
+        public bool IsSend = false;
21
+
22
+
23
+        public UIInfoModel(string info, string cmd)
24
+        {
25
+            this.info = info;
26
+            this.cmd = cmd;
27
+        }
28
+
29
+
30
+        public UIInfoModel(string info)
31
+        {
32
+            this.info = info;
33
+        }
34
+
35
+        public UIInfoModel setAction(int action)
36
+        {
37
+            this.action = action;
38
+            return this;
39
+        }
40
+
41
+        public UIInfoModel setIsSend(bool IsSend)
42
+        {
43
+            this.IsSend = IsSend;
44
+            return this;
45
+        }
46
+
47
+        public UIInfoModel setCmd(string cmd)
48
+        {
49
+            this.cmd = cmd;
50
+            return this;
51
+        }
52
+
53
+
54
+        public UIInfoModel setInfo(string info)
55
+        {
56
+            this.info = info;
57
+            return this;
58
+        }
59
+
60
+
61
+        public override string ToString()
62
+        {
63
+            string res = time + " - ";
64
+            if (!info.Trim().Equals(""))
65
+            {
66
+                res += this.info + " . ";
67
+            }
68
+
69
+            if (!cmd.Trim().Equals(""))
70
+            {
71
+                res += "cmdId=" + cmd.Substring(SystemConfig.FunctionCodeStartPos, SystemConfig.FunctionCodeLength) +
72
+                       ".cmd=[" + cmd + "]";
73
+            }
74
+            return res;
75
+        }
76
+    }
77
+}

+ 14 - 0
DotNettyFrom/config/SystemConfig.cs Voir le fichier

@@ -0,0 +1,14 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace DotNettyFrom.config
8
+{
9
+    public class SystemConfig
10
+    {
11
+        public static int FunctionCodeStartPos = 18;
12
+        public static int FunctionCodeLength = 2;
13
+    }
14
+}

+ 141 - 0
DotNettyFrom/netty/NettyClient.cs Voir le fichier

@@ -0,0 +1,141 @@
1
+using System;
2
+using System.Collections.Concurrent;
3
+using System.Collections.Generic;
4
+using System.Linq;
5
+using System.Net;
6
+using System.Text;
7
+using System.Threading;
8
+using System.Threading.Tasks;
9
+using DotNetty.Buffers;
10
+using DotNetty.Handlers.Timeout;
11
+using DotNetty.Transport.Bootstrapping;
12
+using DotNetty.Transport.Channels;
13
+using DotNetty.Transport.Channels.Sockets;
14
+using DotNettyFrom.common;
15
+
16
+namespace DotNettyFrom.netty
17
+{
18
+    public class NettyClient
19
+    {
20
+        public static IChannelHandlerContext Context;
21
+        private MultithreadEventLoopGroup _group;
22
+        private NettyClientHandler _clientHandler;
23
+
24
+        public void StartNetty(string host, int port)
25
+        {
26
+            IPAddress hostIp = IPAddress.Parse(host);
27
+            RunClientAsync(hostIp, port);
28
+        }
29
+
30
+        private async void RunClientAsync(IPAddress HostIP, int Port)
31
+        {
32
+            _group = new MultithreadEventLoopGroup();
33
+            var bootstrap = new Bootstrap();
34
+            bootstrap
35
+                .Group(_group)
36
+                .Channel<TcpSocketChannel>()
37
+                .Option(ChannelOption.TcpNodelay, true)
38
+                .Handler(new ActionChannelInitializer<ISocketChannel>(channel =>
39
+                {
40
+                    IChannelPipeline pipeline = channel.Pipeline;
41
+                    //                    pipeline.AddLast("framing-dec", new LengthFieldBasedFrameDecoder(ushort.MaxValue, 10, 2, 1, 0));
42
+                    pipeline.AddLast("idle", new IdleStateHandler(10, 20, 15));
43
+                    _clientHandler = new NettyClientHandler();
44
+                    pipeline.AddLast("echo", _clientHandler);
45
+                }));
46
+            try
47
+            {
48
+                await bootstrap.ConnectAsync(new IPEndPoint(HostIP, Port));
49
+            }
50
+            catch (Exception e)
51
+            {
52
+                Console.WriteLine(e);
53
+                await _group.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1));
54
+            }
55
+            
56
+        }
57
+
58
+
59
+        public void SendData(string hex)
60
+        {
61
+            if (Context.Channel.Active)
62
+            {
63
+                IByteBuffer msg = Unpooled.Buffer(128);
64
+                byte[] messageBytes = Encoding.UTF8.GetBytes(DateTime.Now.ToLongDateString());
65
+                msg.WriteBytes(messageBytes);
66
+                Context.Channel.WriteAndFlushAsync(msg);
67
+            }
68
+            else
69
+            {
70
+                DataModel.ReceCollection.Add(new UIInfoModel("连接已断开", ""));
71
+            }
72
+        }
73
+
74
+
75
+        public void StopNetty()
76
+        {
77
+            Context.Channel.CloseAsync();
78
+            _group?.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1));
79
+            _group = null;
80
+            Context.CloseAsync();
81
+            Context = null;
82
+            _clientHandler = null;
83
+        }
84
+
85
+
86
+        class NettyClientHandler : ChannelHandlerAdapter
87
+        {
88
+            public override void ChannelActive(IChannelHandlerContext context)
89
+            {
90
+                Context = context;
91
+
92
+
93
+                IByteBuffer msg = Unpooled.Buffer(128);
94
+                byte[] messageBytes = Encoding.UTF8.GetBytes(DateTime.Now.ToLongDateString());
95
+                msg.WriteBytes(messageBytes);
96
+                context.WriteAndFlushAsync(msg);
97
+
98
+                DataModel.ReceCollection.Add(new UIInfoModel("", DateTime.Now.ToLongDateString() + "channeiActive"));
99
+            }
100
+
101
+
102
+            public override void ChannelRead(IChannelHandlerContext context, object message)
103
+            {
104
+                if (message is IByteBuffer buffer)
105
+                {
106
+                    string abc = buffer.ToString(Encoding.UTF8);
107
+
108
+                    DataModel.ReceCollection.Add(new UIInfoModel("", "收到:-----------" + abc));
109
+                }
110
+
111
+//                IByteBuffer msg = Unpooled.Buffer(128);
112
+//                byte[] messageBytes = Encoding.UTF8.GetBytes(DateTime.Now.ToLongDateString());
113
+//                msg.WriteBytes(messageBytes);
114
+//                context.WriteAndFlushAsync(msg);
115
+            }
116
+
117
+            public override void ChannelReadComplete(IChannelHandlerContext context)
118
+            {
119
+                base.ChannelReadComplete(context);
120
+            }
121
+
122
+            public override void UserEventTriggered(IChannelHandlerContext context, object evt)
123
+            {
124
+                base.UserEventTriggered(context, evt);
125
+            }
126
+
127
+            public override void ExceptionCaught(IChannelHandlerContext context, Exception exception)
128
+            {
129
+                base.ExceptionCaught(context, exception);
130
+                Console.WriteLine(exception.Message);
131
+                DataModel.ReceCollection.Add(new UIInfoModel("", "ExceptionCaught:" + exception.Message));
132
+            }
133
+
134
+            public override void ChannelInactive(IChannelHandlerContext context)
135
+            {
136
+                base.ChannelInactive(context);
137
+                DataModel.ReceCollection.Add(new UIInfoModel("", "ChannelInactive"));
138
+            }
139
+        }
140
+    }
141
+}

+ 58 - 0
DotNettyFrom/packages.config Voir le fichier

@@ -0,0 +1,58 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<packages>
3
+  <package id="DotNetty.Buffers" version="0.4.6" targetFramework="net461" />
4
+  <package id="DotNetty.Codecs" version="0.4.6" targetFramework="net461" />
5
+  <package id="DotNetty.Common" version="0.4.6" targetFramework="net461" />
6
+  <package id="DotNetty.Handlers" version="0.4.6" targetFramework="net461" />
7
+  <package id="DotNetty.Transport" version="0.4.6" targetFramework="net461" />
8
+  <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="1.1.0" targetFramework="net461" />
9
+  <package id="Microsoft.Extensions.Logging" version="1.1.1" targetFramework="net461" />
10
+  <package id="Microsoft.Extensions.Logging.Abstractions" version="1.1.1" targetFramework="net461" />
11
+  <package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net461" />
12
+  <package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net461" />
13
+  <package id="NETStandard.Library" version="1.6.1" targetFramework="net461" />
14
+  <package id="System.AppContext" version="4.3.0" targetFramework="net461" />
15
+  <package id="System.Collections" version="4.3.0" targetFramework="net461" />
16
+  <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" />
17
+  <package id="System.ComponentModel" version="4.3.0" targetFramework="net461" />
18
+  <package id="System.Console" version="4.3.0" targetFramework="net461" />
19
+  <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" />
20
+  <package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net461" />
21
+  <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" />
22
+  <package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net461" />
23
+  <package id="System.Globalization" version="4.3.0" targetFramework="net461" />
24
+  <package id="System.Globalization.Calendars" version="4.3.0" targetFramework="net461" />
25
+  <package id="System.IO" version="4.3.0" targetFramework="net461" />
26
+  <package id="System.IO.Compression" version="4.3.0" targetFramework="net461" />
27
+  <package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net461" />
28
+  <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" />
29
+  <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" />
30
+  <package id="System.Linq" version="4.3.0" targetFramework="net461" />
31
+  <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" />
32
+  <package id="System.Net.Http" version="4.3.0" targetFramework="net461" />
33
+  <package id="System.Net.Primitives" version="4.3.0" targetFramework="net461" />
34
+  <package id="System.Net.Sockets" version="4.3.0" targetFramework="net461" />
35
+  <package id="System.ObjectModel" version="4.3.0" targetFramework="net461" />
36
+  <package id="System.Reflection" version="4.3.0" targetFramework="net461" />
37
+  <package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net461" />
38
+  <package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net461" />
39
+  <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461" />
40
+  <package id="System.Runtime" version="4.3.0" targetFramework="net461" />
41
+  <package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net461" />
42
+  <package id="System.Runtime.Handles" version="4.3.0" targetFramework="net461" />
43
+  <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461" />
44
+  <package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net461" />
45
+  <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" />
46
+  <package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" />
47
+  <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
48
+  <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
49
+  <package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
50
+  <package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" />
51
+  <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461" />
52
+  <package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net461" />
53
+  <package id="System.Threading" version="4.3.0" targetFramework="net461" />
54
+  <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" />
55
+  <package id="System.Threading.Timer" version="4.3.0" targetFramework="net461" />
56
+  <package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net461" />
57
+  <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net461" />
58
+</packages>

+ 103 - 0
DotNettyFromTests/DotNettyFromTests.csproj Voir le fichier

@@ -0,0 +1,103 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{BE93EEC6-53F3-43B9-B4BB-291CDAE46290}</ProjectGuid>
8
+    <OutputType>Library</OutputType>
9
+    <AppDesignerFolder>Properties</AppDesignerFolder>
10
+    <RootNamespace>DotNettyFromTests</RootNamespace>
11
+    <AssemblyName>DotNettyFromTests</AssemblyName>
12
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
13
+    <FileAlignment>512</FileAlignment>
14
+    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
15
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
16
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
17
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
18
+    <IsCodedUITest>False</IsCodedUITest>
19
+    <TestProjectType>UnitTest</TestProjectType>
20
+    <TargetFrameworkProfile />
21
+    <NuGetPackageImportStamp>
22
+    </NuGetPackageImportStamp>
23
+  </PropertyGroup>
24
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25
+    <DebugSymbols>true</DebugSymbols>
26
+    <DebugType>full</DebugType>
27
+    <Optimize>false</Optimize>
28
+    <OutputPath>bin\Debug\</OutputPath>
29
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
30
+    <ErrorReport>prompt</ErrorReport>
31
+    <WarningLevel>4</WarningLevel>
32
+  </PropertyGroup>
33
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
34
+    <DebugType>pdbonly</DebugType>
35
+    <Optimize>true</Optimize>
36
+    <OutputPath>bin\Release\</OutputPath>
37
+    <DefineConstants>TRACE</DefineConstants>
38
+    <ErrorReport>prompt</ErrorReport>
39
+    <WarningLevel>4</WarningLevel>
40
+  </PropertyGroup>
41
+  <ItemGroup>
42
+    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
43
+      <HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
44
+    </Reference>
45
+    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
46
+      <HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
47
+    </Reference>
48
+    <Reference Include="System" />
49
+  </ItemGroup>
50
+  <Choose>
51
+    <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
52
+      <ItemGroup>
53
+        <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
54
+      </ItemGroup>
55
+    </When>
56
+    <Otherwise>
57
+      <ItemGroup>
58
+        <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
59
+      </ItemGroup>
60
+    </Otherwise>
61
+  </Choose>
62
+  <ItemGroup>
63
+    <Compile Include="Properties\AssemblyInfo.cs" />
64
+  </ItemGroup>
65
+  <ItemGroup>
66
+    <None Include="packages.config" />
67
+  </ItemGroup>
68
+  <Choose>
69
+    <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
70
+      <ItemGroup>
71
+        <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
72
+          <Private>False</Private>
73
+        </Reference>
74
+        <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
75
+          <Private>False</Private>
76
+        </Reference>
77
+        <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
78
+          <Private>False</Private>
79
+        </Reference>
80
+        <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
81
+          <Private>False</Private>
82
+        </Reference>
83
+      </ItemGroup>
84
+    </When>
85
+  </Choose>
86
+  <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
87
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
88
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
89
+    <PropertyGroup>
90
+      <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
91
+    </PropertyGroup>
92
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props'))" />
93
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets'))" />
94
+  </Target>
95
+  <Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" />
96
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
97
+       Other similar extension points exist, see Microsoft.Common.targets.
98
+  <Target Name="BeforeBuild">
99
+  </Target>
100
+  <Target Name="AfterBuild">
101
+  </Target>
102
+  -->
103
+</Project>

+ 36 - 0
DotNettyFromTests/Properties/AssemblyInfo.cs Voir le fichier

@@ -0,0 +1,36 @@
1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// 有关程序集的一般信息由以下
6
+// 控制。更改这些特性值可修改
7
+// 与程序集关联的信息。
8
+[assembly: AssemblyTitle("DotNettyFromTests")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("")]
12
+[assembly: AssemblyProduct("DotNettyFromTests")]
13
+[assembly: AssemblyCopyright("Copyright ©  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("be93eec6-53f3-43b9-b4bb-291cdae46290")]
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")]

+ 20 - 0
DotNettyFromTests/common/UIInfoModelTests.cs Voir le fichier

@@ -0,0 +1,20 @@
1
+using Microsoft.VisualStudio.TestTools.UnitTesting;
2
+using DotNettyFrom.common;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Linq;
6
+using System.Text;
7
+using System.Threading.Tasks;
8
+
9
+namespace DotNettyFrom.common.Tests
10
+{
11
+    [TestClass()]
12
+    public class UIInfoModelTests
13
+    {
14
+        [TestMethod()]
15
+        public void setInfoTest()
16
+        {
17
+            Assert.Fail();
18
+        }
19
+    }
20
+}

+ 5 - 0
DotNettyFromTests/packages.config Voir le fichier

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<packages>
3
+  <package id="MSTest.TestAdapter" version="1.1.18" targetFramework="net461" />
4
+  <package id="MSTest.TestFramework" version="1.1.18" targetFramework="net461" />
5
+</packages>

+ 17 - 0
README.md Voir le fichier

@@ -0,0 +1,17 @@
1
+# 使用
2
+>Visual Studio 2017.
3
+
4
+## 新建一个C#项目
5
+
6
+在`工具->Nuget包管理器->程序包管理器控制台`输入
7
+
8
+[https://www.nuget.org/packages?q=DotNetty&prerel=false](https://www.nuget.org/packages?q=DotNetty&prerel=false)
9
+
10
+
11
+添加以下依赖包
12
+```
13
+Install-Package DotNetty.Common -Version 0.4.6
14
+Install-Package DotNetty.Transport -Version 0.4.6
15
+Install-Package DotNetty.Codecs -Version 0.4.6
16
+Install-Package DotNetty.Handlers -Version 0.4.6
17
+```

+ 14 - 0
TestServer/App.config Voir le fichier

@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<configuration>
3
+    <startup> 
4
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5
+    </startup>
6
+  <runtime>
7
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8
+      <dependentAssembly>
9
+        <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
10
+        <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
11
+      </dependentAssembly>
12
+    </assemblyBinding>
13
+  </runtime>
14
+</configuration>

+ 58 - 0
TestServer/Program.cs Voir le fichier

@@ -0,0 +1,58 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using DotNetty.Handlers.Timeout;
7
+using DotNetty.Transport.Bootstrapping;
8
+using DotNetty.Transport.Channels;
9
+using DotNetty.Transport.Channels.Sockets;
10
+using NotNettyServer;
11
+
12
+namespace TestServer
13
+{
14
+    class Program
15
+    {
16
+        private static int Port = 4001;
17
+
18
+        static void Main(string[] args)
19
+        {
20
+            Console.WriteLine("Server");
21
+            RunServerAsync().Wait();
22
+        }
23
+
24
+        static async Task RunServerAsync()
25
+        {
26
+            var bossGroup = new MultithreadEventLoopGroup(1);
27
+            var workerGroup = new MultithreadEventLoopGroup();
28
+
29
+            try
30
+            {
31
+                var bootstrap = new ServerBootstrap();
32
+                bootstrap
33
+                    .Group(bossGroup, workerGroup)
34
+                    .Channel<TcpServerSocketChannel>()
35
+                    .Option(ChannelOption.SoBacklog, 1024)
36
+                    .ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel =>
37
+                    {
38
+                        IChannelPipeline pipeline = channel.Pipeline;
39
+                        //                        pipeline.AddLast("framing-enc", new LengthFieldPrepender(10));
40
+                        //                        pipeline.AddLast("framing-dec", new LengthFieldBasedFrameDecoder(ushort.MaxValue, 10, 2, 1, 0));
41
+                        pipeline.AddLast("idle", new IdleStateHandler(10, 20, 15));
42
+                        pipeline.AddLast("echo", new ServerHandler());
43
+                    }));
44
+                IChannel boundChannel = await bootstrap.BindAsync(Port);
45
+
46
+                Console.ReadLine();
47
+
48
+                await boundChannel.CloseAsync();
49
+            }
50
+            finally
51
+            {
52
+                await Task.WhenAll(
53
+                    bossGroup.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1)),
54
+                    workerGroup.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1)));
55
+            }
56
+        }
57
+    }
58
+}

+ 36 - 0
TestServer/Properties/AssemblyInfo.cs Voir le fichier

@@ -0,0 +1,36 @@
1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// 有关程序集的一般信息由以下
6
+// 控制。更改这些特性值可修改
7
+// 与程序集关联的信息。
8
+[assembly: AssemblyTitle("TestServer")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("")]
12
+[assembly: AssemblyProduct("TestServer")]
13
+[assembly: AssemblyCopyright("Copyright ©  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("4ed061b5-251e-4813-abad-4b6b57a4fc67")]
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")]

+ 67 - 0
TestServer/ServerHandler.cs Voir le fichier

@@ -0,0 +1,67 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using DotNetty.Buffers;
7
+using DotNetty.Handlers.Timeout;
8
+using DotNetty.Transport.Channels;
9
+
10
+
11
+namespace NotNettyServer
12
+{
13
+    public class ServerHandler : ChannelHandlerAdapter
14
+    {
15
+        public override void ChannelActive(IChannelHandlerContext context)
16
+        {
17
+            base.ChannelActive(context);
18
+            Console.WriteLine("Server ChannelActive");
19
+        }
20
+
21
+        public override void ChannelRead(IChannelHandlerContext context, object message)
22
+        {
23
+            if (message is IByteBuffer buffer)
24
+            {
25
+                string abc = buffer.ToString(Encoding.UTF8);
26
+               
27
+                Console.WriteLine("收到:" + abc);
28
+            }
29
+            context.WriteAsync(message); //回复
30
+        }
31
+
32
+        public override void ChannelReadComplete(IChannelHandlerContext context) => context.Flush();
33
+
34
+
35
+        public override void UserEventTriggered(IChannelHandlerContext context, object evt)
36
+        {
37
+            base.UserEventTriggered(context, evt);
38
+            if (evt is IdleStateEvent state)
39
+            {
40
+                if (state == IdleStateEvent.ReaderIdleStateEvent)
41
+                {
42
+                    Console.WriteLine("Read超时");
43
+                }
44
+                else if (state == IdleStateEvent.WriterIdleStateEvent)
45
+                {
46
+                    Console.WriteLine("Write超时");
47
+                }
48
+                if (state == IdleStateEvent.AllIdleStateEvent)
49
+                {
50
+                    Console.WriteLine("All超时");
51
+                }
52
+            }
53
+        }
54
+
55
+        public override void ChannelInactive(IChannelHandlerContext context)
56
+        {
57
+            base.ChannelInactive(context);
58
+            Console.WriteLine("inactive");
59
+        }
60
+
61
+        public override void ExceptionCaught(IChannelHandlerContext context, Exception exception)
62
+        {
63
+            Console.WriteLine("Exception: " + exception);
64
+            context.CloseAsync();
65
+        }
66
+    }
67
+}

+ 133 - 0
TestServer/TestServer.csproj Voir le fichier

@@ -0,0 +1,133 @@
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>{4ED061B5-251E-4813-ABAD-4B6B57A4FC67}</ProjectGuid>
8
+    <OutputType>Exe</OutputType>
9
+    <RootNamespace>TestServer</RootNamespace>
10
+    <AssemblyName>TestServer</AssemblyName>
11
+    <TargetFrameworkVersion>v4.6.1</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="DotNetty.Buffers, Version=0.4.6.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
36
+      <HintPath>..\packages\DotNetty.Buffers.0.4.6\lib\net45\DotNetty.Buffers.dll</HintPath>
37
+    </Reference>
38
+    <Reference Include="DotNetty.Codecs, Version=0.4.6.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
39
+      <HintPath>..\packages\DotNetty.Codecs.0.4.6\lib\net45\DotNetty.Codecs.dll</HintPath>
40
+    </Reference>
41
+    <Reference Include="DotNetty.Common, Version=0.4.6.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
42
+      <HintPath>..\packages\DotNetty.Common.0.4.6\lib\net45\DotNetty.Common.dll</HintPath>
43
+    </Reference>
44
+    <Reference Include="DotNetty.Handlers, Version=0.4.6.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
45
+      <HintPath>..\packages\DotNetty.Handlers.0.4.6\lib\net45\DotNetty.Handlers.dll</HintPath>
46
+    </Reference>
47
+    <Reference Include="DotNetty.Transport, Version=0.4.6.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
48
+      <HintPath>..\packages\DotNetty.Transport.0.4.6\lib\net45\DotNetty.Transport.dll</HintPath>
49
+    </Reference>
50
+    <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
51
+      <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.1.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
52
+    </Reference>
53
+    <Reference Include="Microsoft.Extensions.Logging, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
54
+      <HintPath>..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll</HintPath>
55
+    </Reference>
56
+    <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
57
+      <HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
58
+    </Reference>
59
+    <Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
60
+      <HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
61
+    </Reference>
62
+    <Reference Include="System" />
63
+    <Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
64
+      <HintPath>..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll</HintPath>
65
+    </Reference>
66
+    <Reference Include="System.ComponentModel.Composition" />
67
+    <Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
68
+      <HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
69
+    </Reference>
70
+    <Reference Include="System.Core" />
71
+    <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
72
+      <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
73
+    </Reference>
74
+    <Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
75
+      <HintPath>..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll</HintPath>
76
+    </Reference>
77
+    <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
78
+      <HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
79
+      <Private>True</Private>
80
+    </Reference>
81
+    <Reference Include="System.IO.Compression.FileSystem" />
82
+    <Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
83
+      <HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
84
+    </Reference>
85
+    <Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
86
+      <HintPath>..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath>
87
+    </Reference>
88
+    <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
89
+      <HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
90
+    </Reference>
91
+    <Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
92
+      <HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
93
+    </Reference>
94
+    <Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
95
+      <HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
96
+    </Reference>
97
+    <Reference Include="System.Numerics" />
98
+    <Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
99
+      <HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
100
+      <Private>True</Private>
101
+    </Reference>
102
+    <Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
103
+      <HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
104
+    </Reference>
105
+    <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
106
+      <HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
107
+    </Reference>
108
+    <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
109
+      <HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
110
+    </Reference>
111
+    <Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
112
+      <HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
113
+    </Reference>
114
+    <Reference Include="System.Xml.Linq" />
115
+    <Reference Include="System.Data.DataSetExtensions" />
116
+    <Reference Include="Microsoft.CSharp" />
117
+    <Reference Include="System.Data" />
118
+    <Reference Include="System.Xml" />
119
+    <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
120
+      <HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath>
121
+    </Reference>
122
+  </ItemGroup>
123
+  <ItemGroup>
124
+    <Compile Include="Program.cs" />
125
+    <Compile Include="Properties\AssemblyInfo.cs" />
126
+    <Compile Include="ServerHandler.cs" />
127
+  </ItemGroup>
128
+  <ItemGroup>
129
+    <None Include="App.config" />
130
+    <None Include="packages.config" />
131
+  </ItemGroup>
132
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
133
+</Project>

+ 58 - 0
TestServer/packages.config Voir le fichier

@@ -0,0 +1,58 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<packages>
3
+  <package id="DotNetty.Buffers" version="0.4.6" targetFramework="net461" />
4
+  <package id="DotNetty.Codecs" version="0.4.6" targetFramework="net461" />
5
+  <package id="DotNetty.Common" version="0.4.6" targetFramework="net461" />
6
+  <package id="DotNetty.Handlers" version="0.4.6" targetFramework="net461" />
7
+  <package id="DotNetty.Transport" version="0.4.6" targetFramework="net461" />
8
+  <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="1.1.0" targetFramework="net461" />
9
+  <package id="Microsoft.Extensions.Logging" version="1.1.1" targetFramework="net461" />
10
+  <package id="Microsoft.Extensions.Logging.Abstractions" version="1.1.1" targetFramework="net461" />
11
+  <package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net461" />
12
+  <package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net461" />
13
+  <package id="NETStandard.Library" version="1.6.1" targetFramework="net461" />
14
+  <package id="System.AppContext" version="4.3.0" targetFramework="net461" />
15
+  <package id="System.Collections" version="4.3.0" targetFramework="net461" />
16
+  <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" />
17
+  <package id="System.ComponentModel" version="4.3.0" targetFramework="net461" />
18
+  <package id="System.Console" version="4.3.0" targetFramework="net461" />
19
+  <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" />
20
+  <package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net461" />
21
+  <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" />
22
+  <package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net461" />
23
+  <package id="System.Globalization" version="4.3.0" targetFramework="net461" />
24
+  <package id="System.Globalization.Calendars" version="4.3.0" targetFramework="net461" />
25
+  <package id="System.IO" version="4.3.0" targetFramework="net461" />
26
+  <package id="System.IO.Compression" version="4.3.0" targetFramework="net461" />
27
+  <package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net461" />
28
+  <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" />
29
+  <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" />
30
+  <package id="System.Linq" version="4.3.0" targetFramework="net461" />
31
+  <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" />
32
+  <package id="System.Net.Http" version="4.3.0" targetFramework="net461" />
33
+  <package id="System.Net.Primitives" version="4.3.0" targetFramework="net461" />
34
+  <package id="System.Net.Sockets" version="4.3.0" targetFramework="net461" />
35
+  <package id="System.ObjectModel" version="4.3.0" targetFramework="net461" />
36
+  <package id="System.Reflection" version="4.3.0" targetFramework="net461" />
37
+  <package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net461" />
38
+  <package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net461" />
39
+  <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461" />
40
+  <package id="System.Runtime" version="4.3.0" targetFramework="net461" />
41
+  <package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net461" />
42
+  <package id="System.Runtime.Handles" version="4.3.0" targetFramework="net461" />
43
+  <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461" />
44
+  <package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net461" />
45
+  <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" />
46
+  <package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" />
47
+  <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
48
+  <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
49
+  <package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
50
+  <package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" />
51
+  <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461" />
52
+  <package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net461" />
53
+  <package id="System.Threading" version="4.3.0" targetFramework="net461" />
54
+  <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" />
55
+  <package id="System.Threading.Timer" version="4.3.0" targetFramework="net461" />
56
+  <package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net461" />
57
+  <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net461" />
58
+</packages>