ソースを参照

添加流量监控例子

yuzhengyang 8 年 前
コミット
b6a95f1a83

+ 81 - 0
Fork.Net/Fork.Net.sln

@@ -41,68 +41,146 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Waka.Lego.Music", "Waka.Leg
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Waka.Lego.Icon", "Waka.Lego.Icon\Waka.Lego.Icon.csproj", "{328B6806-CC39-4232-AE51-13AABF9A583B}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Waka.Lego.Icon", "Waka.Lego.Icon\Waka.Lego.Icon.csproj", "{328B6806-CC39-4232-AE51-13AABF9A583B}"
 EndProject
 EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Fork.Test", "Fork.Test", "{A89FC45A-A907-4487-8719-114530A62684}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpSniffer", "SharpSniffer\SharpSniffer.csproj", "{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.NetFlowMonitor", "Test.NetFlowMonitor\Test.NetFlowMonitor.csproj", "{93F95A84-D0CD-409C-8422-2EF044AB04E1}"
+EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|Any CPU = Debug|Any CPU
+		Debug|x86 = Debug|x86
 		Release|Any CPU = Release|Any CPU
 		Release|Any CPU = Release|Any CPU
+		Release|x86 = Release|x86
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Debug|x86.Build.0 = Debug|Any CPU
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Release|Any CPU.Build.0 = Release|Any CPU
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Release|Any CPU.Build.0 = Release|Any CPU
+		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Release|x86.ActiveCfg = Release|Any CPU
+		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Release|x86.Build.0 = Release|Any CPU
 		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Debug|x86.Build.0 = Debug|Any CPU
 		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Release|Any CPU.Build.0 = Release|Any CPU
 		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Release|x86.ActiveCfg = Release|Any CPU
+		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5}.Release|x86.Build.0 = Release|Any CPU
 		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Debug|x86.Build.0 = Debug|Any CPU
 		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Release|Any CPU.Build.0 = Release|Any CPU
 		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Release|x86.ActiveCfg = Release|Any CPU
+		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1}.Release|x86.Build.0 = Release|Any CPU
 		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Debug|x86.Build.0 = Debug|Any CPU
 		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Release|Any CPU.Build.0 = Release|Any CPU
 		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Release|x86.ActiveCfg = Release|Any CPU
+		{E9A97673-3E27-4A49-90BC-8806411A2F57}.Release|x86.Build.0 = Release|Any CPU
 		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Debug|x86.Build.0 = Debug|Any CPU
 		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Release|Any CPU.Build.0 = Release|Any CPU
 		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Release|x86.ActiveCfg = Release|Any CPU
+		{E1897235-0E04-420D-B6D5-29BEA14DA1FD}.Release|x86.Build.0 = Release|Any CPU
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|x86.Build.0 = Debug|Any CPU
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|Any CPU.Build.0 = Release|Any CPU
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|x86.ActiveCfg = Release|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|x86.Build.0 = Release|Any CPU
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|x86.Build.0 = Debug|Any CPU
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|Any CPU.Build.0 = Release|Any CPU
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|x86.ActiveCfg = Release|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|x86.Build.0 = Release|Any CPU
 		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Debug|x86.Build.0 = Debug|Any CPU
 		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Release|Any CPU.Build.0 = Release|Any CPU
 		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Release|Any CPU.Build.0 = Release|Any CPU
+		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Release|x86.ActiveCfg = Release|Any CPU
+		{EE89927C-03A6-4E57-B69A-DE71B101FCA7}.Release|x86.Build.0 = Release|Any CPU
 		{490E9BE8-814D-4617-8271-41A73C373F7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{490E9BE8-814D-4617-8271-41A73C373F7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{490E9BE8-814D-4617-8271-41A73C373F7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{490E9BE8-814D-4617-8271-41A73C373F7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{490E9BE8-814D-4617-8271-41A73C373F7D}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{490E9BE8-814D-4617-8271-41A73C373F7D}.Debug|x86.Build.0 = Debug|Any CPU
 		{490E9BE8-814D-4617-8271-41A73C373F7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{490E9BE8-814D-4617-8271-41A73C373F7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{490E9BE8-814D-4617-8271-41A73C373F7D}.Release|Any CPU.Build.0 = Release|Any CPU
 		{490E9BE8-814D-4617-8271-41A73C373F7D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{490E9BE8-814D-4617-8271-41A73C373F7D}.Release|x86.ActiveCfg = Release|Any CPU
+		{490E9BE8-814D-4617-8271-41A73C373F7D}.Release|x86.Build.0 = Release|Any CPU
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Debug|x86.Build.0 = Debug|Any CPU
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Release|Any CPU.Build.0 = Release|Any CPU
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Release|x86.ActiveCfg = Release|Any CPU
+		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Release|x86.Build.0 = Release|Any CPU
 		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Debug|x86.Build.0 = Debug|Any CPU
 		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Release|Any CPU.Build.0 = Release|Any CPU
 		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Release|x86.ActiveCfg = Release|Any CPU
+		{7ACB538D-2A75-4602-9422-1C5E72AB840A}.Release|x86.Build.0 = Release|Any CPU
 		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Debug|x86.Build.0 = Debug|Any CPU
 		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Release|Any CPU.Build.0 = Release|Any CPU
 		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Release|x86.ActiveCfg = Release|Any CPU
+		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964}.Release|x86.Build.0 = Release|Any CPU
 		{B4E47708-0D92-4308-B605-1B9657B308CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{B4E47708-0D92-4308-B605-1B9657B308CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{B4E47708-0D92-4308-B605-1B9657B308CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{B4E47708-0D92-4308-B605-1B9657B308CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{B4E47708-0D92-4308-B605-1B9657B308CF}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{B4E47708-0D92-4308-B605-1B9657B308CF}.Debug|x86.Build.0 = Debug|Any CPU
 		{B4E47708-0D92-4308-B605-1B9657B308CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{B4E47708-0D92-4308-B605-1B9657B308CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{B4E47708-0D92-4308-B605-1B9657B308CF}.Release|Any CPU.Build.0 = Release|Any CPU
 		{B4E47708-0D92-4308-B605-1B9657B308CF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{B4E47708-0D92-4308-B605-1B9657B308CF}.Release|x86.ActiveCfg = Release|Any CPU
+		{B4E47708-0D92-4308-B605-1B9657B308CF}.Release|x86.Build.0 = Release|Any CPU
 		{328B6806-CC39-4232-AE51-13AABF9A583B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{328B6806-CC39-4232-AE51-13AABF9A583B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{328B6806-CC39-4232-AE51-13AABF9A583B}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{328B6806-CC39-4232-AE51-13AABF9A583B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{328B6806-CC39-4232-AE51-13AABF9A583B}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{328B6806-CC39-4232-AE51-13AABF9A583B}.Debug|x86.Build.0 = Debug|Any CPU
 		{328B6806-CC39-4232-AE51-13AABF9A583B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{328B6806-CC39-4232-AE51-13AABF9A583B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{328B6806-CC39-4232-AE51-13AABF9A583B}.Release|Any CPU.Build.0 = Release|Any CPU
 		{328B6806-CC39-4232-AE51-13AABF9A583B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{328B6806-CC39-4232-AE51-13AABF9A583B}.Release|x86.ActiveCfg = Release|Any CPU
+		{328B6806-CC39-4232-AE51-13AABF9A583B}.Release|x86.Build.0 = Release|Any CPU
+		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Debug|x86.ActiveCfg = Debug|x86
+		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Debug|x86.Build.0 = Debug|x86
+		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Release|Any CPU.ActiveCfg = Release|x86
+		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Release|x86.ActiveCfg = Release|x86
+		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Release|x86.Build.0 = Release|x86
+		{93F95A84-D0CD-409C-8422-2EF044AB04E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{93F95A84-D0CD-409C-8422-2EF044AB04E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{93F95A84-D0CD-409C-8422-2EF044AB04E1}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{93F95A84-D0CD-409C-8422-2EF044AB04E1}.Debug|x86.Build.0 = Debug|Any CPU
+		{93F95A84-D0CD-409C-8422-2EF044AB04E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{93F95A84-D0CD-409C-8422-2EF044AB04E1}.Release|Any CPU.Build.0 = Release|Any CPU
+		{93F95A84-D0CD-409C-8422-2EF044AB04E1}.Release|x86.ActiveCfg = Release|Any CPU
+		{93F95A84-D0CD-409C-8422-2EF044AB04E1}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE
@@ -111,6 +189,7 @@ Global
 		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5} = {F222E566-DA0C-443C-BB9F-80536F02DB36}
 		{5B8EEEC7-AEB5-407D-9DC1-1C59E53F78D5} = {F222E566-DA0C-443C-BB9F-80536F02DB36}
 		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1} = {BF970206-CAA8-46C3-9F1A-46BB82D51DC4}
 		{E10EC8D2-22E2-4387-9D9B-36A5429B67C1} = {BF970206-CAA8-46C3-9F1A-46BB82D51DC4}
 		{E9A97673-3E27-4A49-90BC-8806411A2F57} = {BF970206-CAA8-46C3-9F1A-46BB82D51DC4}
 		{E9A97673-3E27-4A49-90BC-8806411A2F57} = {BF970206-CAA8-46C3-9F1A-46BB82D51DC4}
+		{E1897235-0E04-420D-B6D5-29BEA14DA1FD} = {A89FC45A-A907-4487-8719-114530A62684}
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B} = {F32378B4-3DDB-491A-8485-20634188C0FD}
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B} = {F32378B4-3DDB-491A-8485-20634188C0FD}
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E} = {F32378B4-3DDB-491A-8485-20634188C0FD}
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E} = {F32378B4-3DDB-491A-8485-20634188C0FD}
 		{EE89927C-03A6-4E57-B69A-DE71B101FCA7} = {F222E566-DA0C-443C-BB9F-80536F02DB36}
 		{EE89927C-03A6-4E57-B69A-DE71B101FCA7} = {F222E566-DA0C-443C-BB9F-80536F02DB36}
@@ -120,5 +199,7 @@ Global
 		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964} = {0DB08A6B-6960-48CD-B23B-6428F47FDA60}
 		{5BD7BF2A-5FFA-45CB-AA5D-25345C77D964} = {0DB08A6B-6960-48CD-B23B-6428F47FDA60}
 		{B4E47708-0D92-4308-B605-1B9657B308CF} = {0DB08A6B-6960-48CD-B23B-6428F47FDA60}
 		{B4E47708-0D92-4308-B605-1B9657B308CF} = {0DB08A6B-6960-48CD-B23B-6428F47FDA60}
 		{328B6806-CC39-4232-AE51-13AABF9A583B} = {0DB08A6B-6960-48CD-B23B-6428F47FDA60}
 		{328B6806-CC39-4232-AE51-13AABF9A583B} = {0DB08A6B-6960-48CD-B23B-6428F47FDA60}
+		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3} = {A89FC45A-A907-4487-8719-114530A62684}
+		{93F95A84-D0CD-409C-8422-2EF044AB04E1} = {A89FC45A-A907-4487-8719-114530A62684}
 	EndGlobalSection
 	EndGlobalSection
 EndGlobal
 EndGlobal

+ 233 - 0
Fork.Net/SharpSniffer/Program.cs

@@ -0,0 +1,233 @@
+//////////////////////////////////
+//  C# 也可以做Sniffer
+//  SharpSniffer
+////////////////////////////////
+using System;
+using System.Collections.Generic;
+//using System.Linq;
+using System.Text;
+using System.Net;
+using System.Net.Sockets;
+
+namespace SharpSniffer
+{
+
+    class Program
+    {
+        static long AllCount = 0;
+
+        static void Main(string[] args)
+        {
+            try
+            {
+                //创建socket
+                Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
+
+                using (socket)
+                {
+                    PrintLine("socket created!");
+
+                    //绑定到本机,端口可以任意
+                    var localHostIpAddress = GetHostAdress();
+                    Console.WriteLine("trying to bind to local IP: {0}", localHostIpAddress);
+                    socket.Bind(new IPEndPoint(localHostIpAddress, 0));
+                    PrintLine("binded to [" + socket.LocalEndPoint + "]");
+
+                    byte[] outValue = BitConverter.GetBytes(0);
+                    byte[] inValue = BitConverter.GetBytes(1);
+                    socket.IOControl(IOControlCode.ReceiveAll, inValue, outValue);   //对IO设置为可以接受所有包
+                    PrintLine("IOControl seted!");
+
+                    byte[] buf = new byte[65535];   //缓存大一点没关系,小了可能一次放不下
+                    PrintLine("Sniffer begined.");
+
+                    IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 0); //从任何地方接收数据
+
+                    int index = 0;  //表示当前是第几个包(1based)
+
+                    while (true)
+                    {
+                        index++;
+                        try
+                        {
+                            ipep.Address = IPAddress.Any;   //从任何地方接收数据
+                            ipep.Port = 0;
+
+                            EndPoint ep = ipep;
+
+                            int recvedSize = socket.ReceiveFrom(buf, ref ep);   //用ReceiveFrom接受数据
+                                                                                //        socket.Receive(buf);             //用Receive也能接受到数据,不过使用ReceiveFrom可以直接获取发送方IP地址
+                            AllCount += recvedSize;
+
+                            //接收到包了,打印出来
+                            //Print('[');
+                            //Print(GetCurrentTimeString());
+                            //PrintLine("] Received [" + recvedSize + "] bytes from [" + ep.ToString() + "]");
+                            ////string s = Encoding.ASCII.GetString(buf, 0, recvedSize);
+                            ////Print("ASCII: \n");
+                            ////PrintLine(s);
+                            //string s = GetByteArrayHexString(buf, 0, recvedSize);
+                            //Print("Hex: \n");
+                            //PrintLine(s);
+
+                            Print(index);
+                            PrintLine(string.Format(" This: {1:f2} KB  /  AllCount: {1:f2} MB",
+                                (double)recvedSize / 1024, (double)AllCount / 1024 / 1024));
+
+                            if (recvedSize > 1000)
+                            {
+                                PrintLine("////////////////////");
+                            }
+                        }
+                        catch (Exception ex)
+                        {
+                            if (ex is SocketException)
+                            {
+                                var sex = (SocketException)ex;
+                                Console.Error.WriteLine("SocketErrorCode=" + sex.ErrorCode);
+                            }
+                            Console.Error.WriteLine(ex);
+                        }
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                if (ex is SocketException)
+                {
+                    var sex = (SocketException)ex;
+                    Console.Error.WriteLine("SocketErrorCode=" + sex.ErrorCode);
+                }
+                Console.Error.WriteLine(ex);
+            }
+        }
+        //获取本机IP地址
+        private static IPAddress GetHostAdress()
+        {
+            string hostName = Dns.GetHostName();
+            var hostAddreses = Dns.GetHostAddresses(hostName);
+            List<IPAddress> addressList = new List<IPAddress>(hostAddreses.Length);
+            foreach (var item in hostAddreses)
+            {
+                if (item.AddressFamily == AddressFamily.InterNetwork)
+                {
+                    addressList.Add(item);
+                }
+            }
+            if (addressList.Count != 0)
+            {
+                if (addressList.Count == 1)
+                {
+                    return addressList[0];
+                }
+                else
+                {
+                    Console.WriteLine("请选择要绑定到的本机IP地址(IPv4):");
+                    for (int i = 0; i < addressList.Count; i++)
+                    {
+                        var addr = addressList[i];
+                        Console.WriteLine("\t{0}: {1}", i, addr);
+                    }
+                    int sel = int.Parse(Console.ReadLine());
+                    return addressList[sel];
+                }
+            }
+            else
+            {
+                Console.Write("请输入本机IP地址:");
+                string s = Console.ReadLine();
+                return IPAddress.Parse(s);
+            }
+        }
+        //获取表示当前时间的字符串
+        private static string GetCurrentTimeString()
+        {
+            DateTime now = DateTime.Now;
+            return now.Hour + ":" + now.Minute + ":" + now.Second + "." + now.Millisecond;
+        }
+        const string HexValues = "0123456789ABCDEF";
+        //把字节数组转换为十六进制表示的字符串
+        private static string GetByteArrayHexString(byte[] buf, int startIndex, int size)
+        {
+            StringBuilder sb = new StringBuilder(size * 5);
+            sb.AppendFormat("{0,3:X}: ", 0);
+            int j = 1;
+            for (int i = startIndex, n = startIndex + size; i < n; i++, j++)
+            {
+                byte b = buf[i];
+                char c = HexValues[(b & 0x0f0) >> 4];
+                sb.Append(c);
+                c = HexValues[(b & 0x0f)];
+                sb.Append(c);
+                sb.Append(' ');
+                if ((j & 0x0f) == 0)
+                {
+                    sb.Append(' ');
+                    //sb.Append(Encoding.ASCII.GetString(buf,i-15,8));
+                    AppendPrintableBytes(sb, buf, i - 15, 8);
+                    sb.Append(' ');
+                    //sb.Append(Encoding.ASCII.GetString(buf, i - 7, 8));
+                    AppendPrintableBytes(sb, buf, i - 7, 8);
+                    if (i + 1 != n)
+                    {
+                        sb.Append('\n');
+                        sb.AppendFormat("{0,3:X}: ", i - 1);    //偏移
+                    }
+                }
+                else if ((j & 0x07) == 0)
+                {
+                    sb.Append(' ');
+                }
+            }
+            int t;
+            if ((t = ((j - 1) & 0x0f)) != 0)
+            {
+                for (int k = 0, kn = 16 - t; k < kn; k++)
+                {
+                    sb.Append("   ");
+                }
+                if (t <= 8)
+                {
+                    sb.Append(' ');
+                }
+
+                sb.Append(' ');
+                //   sb.Append(Encoding.ASCII.GetString(buf, startIndex + size - t, t>8?8:t));
+                AppendPrintableBytes(sb, buf, startIndex + size - t, t > 8 ? 8 : t);
+                if (t > 8)
+                {
+                    sb.Append(' ');
+                    //   sb.Append(Encoding.ASCII.GetString(buf, startIndex + size - t + 8, t - 8));
+                    AppendPrintableBytes(sb, buf, startIndex + size - t + 8, t - 8);
+                }
+            }
+            return sb.ToString();
+        }
+        //向sb中添加buf中可打印字符,不可打印字符用'.'代替
+        private static void AppendPrintableBytes(StringBuilder sb, byte[] buf, int startIndex, int len)
+        {
+            for (int i = startIndex, n = startIndex + len; i < n; i++)
+            {
+                char c = (char)buf[i];
+                if (!char.IsControl(c))
+                {
+                    sb.Append(c);
+                }
+                else
+                {
+                    sb.Append('.');
+                }
+            }
+        }
+        //打印t+'\n'
+        static void PrintLine<T>(T t)
+        {
+            Console.WriteLine(t);
+        }
+        //打印t
+        static void Print<T>(T t)
+        {
+            Console.Write(t);
+        }
+    }
+}

+ 36 - 0
Fork.Net/SharpSniffer/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("SharpSniffer")]
+[assembly: AssemblyDescription("C#版Sniffer")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("NUAA")]
+[assembly: AssemblyProduct("SharpSniffer")]
+[assembly: AssemblyCopyright("Copyright © NUAA 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("fc833fe1-0fc9-42c1-9331-528e4fcabc50")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.1.0.0")]
+[assembly: AssemblyFileVersion("1.1.0.0")]

+ 57 - 0
Fork.Net/SharpSniffer/SharpSniffer.csproj

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>SharpSniffer</RootNamespace>
+    <AssemblyName>SharpSniffer</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="app.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 3 - 0
Fork.Net/SharpSniffer/app.config

@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>

+ 6 - 0
Fork.Net/Test.NetFlowMonitor/App.config

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

+ 37 - 0
Fork.Net/Test.NetFlowMonitor/ProcessPerformanceInfo.cs

@@ -0,0 +1,37 @@
+using SharpPcap;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Test.NetFlowMonitor
+{
+    //记录特定进程性能信息的类
+    public class ProcessPerformanceInfo : IDisposable
+    {
+        public int ProcessID { get; set; }//进程ID
+        public string ProcessName { get; set; }//进程名
+        public float PrivateWorkingSet { get; set; }//私有工作集(KB)
+        public float WorkingSet { get; set; }//工作集(KB)
+        public float CpuTime { get; set; }//CPU占用率(%)
+        public float IOOtherBytes { get; set; }//每秒IO操作(不包含控制操作)读写数据的字节数(KB)
+        public int IOOtherOperations { get; set; }//每秒IO操作数(不包括读写)(个数)
+        public long NetSendBytes { get; set; }//网络发送数据字节数
+        public long NetRecvBytes { get; set; }//网络接收数据字节数
+        public long NetTotalBytes { get; set; }//网络数据总字节数
+        public List<ICaptureDevice> dev = new List<ICaptureDevice>();
+
+        /// <summary>
+        /// 实现IDisposable的方法
+        /// </summary>
+        public void Dispose()
+        {
+            foreach (ICaptureDevice d in dev)
+            {
+                d.StopCapture();
+                d.Close();
+            }
+        }
+    }
+}

+ 166 - 0
Fork.Net/Test.NetFlowMonitor/Program.cs

@@ -0,0 +1,166 @@
+using SharpPcap;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Test.NetFlowMonitor
+{
+    class Program
+    {
+        public static ProcessPerformanceInfo ProcInfo { get; set; }
+        static void Main(string[] args)
+        {
+            #region 第一步 获取指定进程使用的所有端口号
+            Process p = Process.GetProcessesByName("Firefox")[0];
+            ProcInfo = new ProcessPerformanceInfo();
+            ProcInfo.ProcessID = p.Id;
+            ProcInfo.ProcessName = p.ProcessName;
+            //进程id
+            int pid = ProcInfo.ProcessID;
+            //存放进程使用的端口号链表
+            List<int> ports = new List<int>();
+
+            #region 获取指定进程对应端口号
+            Process pro = new Process();
+            pro.StartInfo.FileName = "cmd.exe";
+            pro.StartInfo.UseShellExecute = false;
+            pro.StartInfo.RedirectStandardInput = true;
+            pro.StartInfo.RedirectStandardOutput = true;
+            pro.StartInfo.RedirectStandardError = true;
+            pro.StartInfo.CreateNoWindow = true;
+            pro.Start();
+            pro.StandardInput.WriteLine("netstat -ano");
+            pro.StandardInput.WriteLine("exit");
+            Regex reg = new Regex("\\s+", RegexOptions.Compiled);
+            string line = null;
+            ports.Clear();
+            while ((line = pro.StandardOutput.ReadLine()) != null)
+            {
+                line = line.Trim();
+                if (line.StartsWith("TCP", StringComparison.OrdinalIgnoreCase))
+                {
+                    line = reg.Replace(line, ",");
+                    string[] arr = line.Split(',');
+                    if (arr[4] == pid.ToString())
+                    {
+                        string soc = arr[1];
+                        int pos = soc.LastIndexOf(':');
+                        int pot = int.Parse(soc.Substring(pos + 1));
+                        ports.Add(pot);
+                    }
+                }
+                else if (line.StartsWith("UDP", StringComparison.OrdinalIgnoreCase))
+                {
+                    line = reg.Replace(line, ",");
+                    string[] arr = line.Split(',');
+                    if (arr[3] == pid.ToString())
+                    {
+                        string soc = arr[1];
+                        int pos = soc.LastIndexOf(':');
+                        int pot = int.Parse(soc.Substring(pos + 1));
+                        ports.Add(pot);
+                    }
+                }
+            }
+            pro.Close();
+            #endregion
+            #endregion
+            #region 第二步 获取本机IP地址和本机网络设备(即网卡)
+            //获取本机IP地址
+            IPAddress[] addrList = Dns.GetHostByName(Dns.GetHostName()).AddressList;
+            string IP = addrList[0].ToString();
+            //获取本机网络设备
+            var devices = CaptureDeviceList.Instance;
+            int count = devices.Count;
+            if (count < 1)
+            {
+                Console.WriteLine("No device found on this machine");
+                return;
+            }
+            #endregion
+            #region 第三步 开始抓包
+            //开始抓包
+            for (int i = 0; i < count; ++i)
+            {
+                for (int j = 0; j < ports.Count; ++j)
+                {
+                    CaptureFlowRecv(IP, ports[j], i);
+                    CaptureFlowSend(IP, ports[j], i);
+                }
+            }
+            #endregion
+
+            while (true)
+            {
+                Console.WriteLine("proc NetTotalBytes : " + ProcInfo.NetTotalBytes);
+                Console.WriteLine("proc NetSendBytes : " + ProcInfo.NetSendBytes);
+                Console.WriteLine("proc NetRecvBytes : " + ProcInfo.NetRecvBytes);
+
+                //每隔1s调用刷新函数对性能参数进行刷新
+                RefershInfo();
+            }
+            //最后要记得调用Dispose方法停止抓包并关闭设备
+            ProcInfo.Dispose();
+        }
+
+        public static void CaptureFlowSend(string IP, int portID, int deviceID)
+        {
+            ICaptureDevice device = (ICaptureDevice)CaptureDeviceList.New()[deviceID];
+
+            device.OnPacketArrival += new PacketArrivalEventHandler(device_OnPacketArrivalSend);
+
+            int readTimeoutMilliseconds = 1000;
+            device.Open(DeviceMode.Promiscuous, readTimeoutMilliseconds);
+
+            string filter = "src host " + IP + " and src port " + portID;
+            device.Filter = filter;
+            device.StartCapture();
+            ProcInfo.dev.Add(device);
+        }
+
+        public static void CaptureFlowRecv(string IP, int portID, int deviceID)
+        {
+            ICaptureDevice device = CaptureDeviceList.New()[deviceID];
+            device.OnPacketArrival += new PacketArrivalEventHandler(device_OnPacketArrivalRecv);
+
+            int readTimeoutMilliseconds = 1000;
+            device.Open(DeviceMode.Promiscuous, readTimeoutMilliseconds);
+
+            //string filter = "dst host " + IP + " and dst port " + portID;
+            //device.Filter = filter;
+            device.StartCapture();
+            ProcInfo.dev.Add(device);
+        }
+        private static void device_OnPacketArrivalSend(object sender, CaptureEventArgs e)
+        {
+            var len = e.Packet.Data.Length;
+            ProcInfo.NetSendBytes += len;
+
+            Console.WriteLine("NowUp={0} Up: {1}KB  Down: {2}KB", e.Packet.Data.Length, ProcInfo.NetSendBytes / 1024, ProcInfo.NetRecvBytes / 1024);
+        }
+
+        private static void device_OnPacketArrivalRecv(object sender, CaptureEventArgs e)
+        {
+            var len = e.Packet.Data.Length;
+            ProcInfo.NetRecvBytes += len;
+            Console.WriteLine("NowDown={0} Up: {1}KB  Down: {2}KB", e.Packet.Data.Length, ProcInfo.NetSendBytes / 1024, ProcInfo.NetRecvBytes / 1024);
+        }
+        /// <summary>
+        /// 实时刷新性能参数
+        /// </summary>
+        public static void RefershInfo()
+        {
+            ProcInfo.NetRecvBytes = 0;
+            ProcInfo.NetSendBytes = 0;
+            ProcInfo.NetTotalBytes = 0;
+            Thread.Sleep(1000);
+            ProcInfo.NetTotalBytes = ProcInfo.NetRecvBytes + ProcInfo.NetSendBytes;
+        }
+    }
+}

+ 36 - 0
Fork.Net/Test.NetFlowMonitor/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("Test.NetFlowMonitor")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Test.NetFlowMonitor")]
+[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("93f95a84-d0cd-409c-8422-2ef044ab04e1")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 67 - 0
Fork.Net/Test.NetFlowMonitor/Test.NetFlowMonitor.csproj

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{93F95A84-D0CD-409C-8422-2EF044AB04E1}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Test.NetFlowMonitor</RootNamespace>
+    <AssemblyName>Test.NetFlowMonitor</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="PacketDotNet">
+      <HintPath>..\Dlls\SharpPcap-4.2.0\Release\PacketDotNet.dll</HintPath>
+    </Reference>
+    <Reference Include="SharpPcap">
+      <HintPath>..\Dlls\SharpPcap-4.2.0\Release\SharpPcap.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ProcessPerformanceInfo.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 1 - 1
Fork.Net/Waka.Lego.Icon/Waka.Lego.Icon.csproj

@@ -5,7 +5,7 @@
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProjectGuid>{328B6806-CC39-4232-AE51-13AABF9A583B}</ProjectGuid>
     <ProjectGuid>{328B6806-CC39-4232-AE51-13AABF9A583B}</ProjectGuid>
-    <OutputType>Library</OutputType>
+    <OutputType>WinExe</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Waka.Lego.Icon</RootNamespace>
     <RootNamespace>Waka.Lego.Icon</RootNamespace>
     <AssemblyName>Waka.Lego.Icon</AssemblyName>
     <AssemblyName>Waka.Lego.Icon</AssemblyName>

+ 1 - 1
Fork.Net/Waka.Lego/Views/MainForm.cs

@@ -18,7 +18,7 @@ namespace Waka.Lego.Views
     {
     {
         string[] plugins = new string[] {
         string[] plugins = new string[] {
                 @"D:\CoCo\GitHub\Fork\Fork.Net\Waka.Lego\bin\Debug\Bin\Plugins\Waka.Lego.Baidu\Waka.Lego.Baidu.dll" ,
                 @"D:\CoCo\GitHub\Fork\Fork.Net\Waka.Lego\bin\Debug\Bin\Plugins\Waka.Lego.Baidu\Waka.Lego.Baidu.dll" ,
-                @"D:\CoCo\GitHub\Fork\Fork.Net\Waka.Lego\bin\Debug\Bin\Plugins\Waka.Lego.Icon\Waka.Lego.Icon.dll",
+                @"D:\CoCo\GitHub\Fork\Fork.Net\Waka.Lego\bin\Debug\Bin\Plugins\Waka.Lego.Icon\Waka.Lego.Icon.exe",
                 @"D:\CoCo\GitHub\Fork\Fork.Net\Waka.Lego\bin\Debug\Bin\Plugins\Waka.Lego.Music\Waka.Lego.Music.dll"};
                 @"D:\CoCo\GitHub\Fork\Fork.Net\Waka.Lego\bin\Debug\Bin\Plugins\Waka.Lego.Music\Waka.Lego.Music.dll"};
 
 
         public MainForm()
         public MainForm()