#ifndef WIN32_LEAN_..._iphelper控件vb">
当前位置:   article > 正文

windows下iphelper工具的实现_iphelper控件vb

iphelper控件vb

windows上涉及到网络编程的都必须懂得查看和操作网卡。重点是怎么干?查手册是个好习惯!

iphelper 官方文档连接

 

然后贴一下源码:

  1. // miniIphelper.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
  2. //
  3. #include "pch.h"
  4. #include <iostream>
  5. #ifndef WIN32_LEAN_AND_MEAN
  6. #define WIN32_LEAN_AND_MEAN
  7. #endif
  8. #include <windows.h>
  9. #include <winsock2.h>
  10. #include <ws2tcpip.h>
  11. #include <iphlpapi.h>
  12. #include <stdio.h>
  13. #include <time.h>
  14. // Need to link with Iphlpapi.lib and Ws2_32.lib
  15. #pragma comment(lib, "iphlpapi.lib")
  16. #pragma comment(lib, "ws2_32.lib")
  17. #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
  18. #define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
  19. /* Note: could also use malloc() and free() */
  20. int main()
  21. {
  22. /* Some general variables */
  23. ULONG ulOutBufLen;
  24. DWORD dwRetVal;
  25. unsigned int i;
  26. /* variables used for GetNetworkParams */
  27. FIXED_INFO *pFixedInfo;
  28. IP_ADDR_STRING *pIPAddr;
  29. /* variables used for GetAdapterInfo */
  30. IP_ADAPTER_INFO *pAdapterInfo;
  31. IP_ADAPTER_INFO *pAdapter;
  32. /* variables used to print DHCP time info */
  33. struct tm newtime;
  34. char buffer[32];
  35. errno_t error;
  36. /* variables used for GetInterfaceInfo */
  37. IP_INTERFACE_INFO *pInterfaceInfo;
  38. /* variables used for GetIpAddrTable */
  39. MIB_IPADDRTABLE *pIPAddrTable;
  40. DWORD dwSize;
  41. IN_ADDR IPAddr;
  42. char *strIPAddr;
  43. /* variables used for AddIpAddress */
  44. UINT iaIPAddress;
  45. UINT imIPMask;
  46. ULONG NTEContext;
  47. ULONG NTEInstance;
  48. /* variables used for GetIpStatistics */
  49. MIB_IPSTATS *pStats;
  50. /* variables used for GetTcpStatistics */
  51. MIB_TCPSTATS *pTCPStats;
  52. printf("------------------------\n");
  53. printf("This is GetNetworkParams\n");
  54. printf("------------------------\n");
  55. pFixedInfo = (FIXED_INFO *)MALLOC(sizeof(FIXED_INFO));
  56. if (pFixedInfo == NULL) {
  57. printf("Error allocating memory needed to call GetNetworkParams\n");
  58. return 1;
  59. }
  60. ulOutBufLen = sizeof(FIXED_INFO);
  61. if (GetNetworkParams(pFixedInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW) {
  62. FREE(pFixedInfo);
  63. pFixedInfo = (FIXED_INFO *)MALLOC(ulOutBufLen);
  64. if (pFixedInfo == NULL) {
  65. printf("Error allocating memory needed to call GetNetworkParams\n");
  66. return 1;
  67. }
  68. }
  69. if (dwRetVal = GetNetworkParams(pFixedInfo, &ulOutBufLen) != NO_ERROR) {
  70. printf("GetNetworkParams failed with error %d\n", dwRetVal);
  71. if (pFixedInfo)
  72. FREE(pFixedInfo);
  73. return 1;
  74. }
  75. else {
  76. printf("\tHost Name: %s\n", pFixedInfo->HostName);
  77. printf("\tDomain Name: %s\n", pFixedInfo->DomainName);
  78. printf("\tDNS Servers:\n");
  79. printf("\t\t%s\n", pFixedInfo->DnsServerList.IpAddress.String);
  80. pIPAddr = pFixedInfo->DnsServerList.Next;
  81. while (pIPAddr) {
  82. printf("\t\t%s\n", pIPAddr->IpAddress.String);
  83. pIPAddr = pIPAddr->Next;
  84. }
  85. printf("\tNode Type: ");
  86. switch (pFixedInfo->NodeType) {
  87. case 1:
  88. printf("%s\n", "Broadcast");
  89. break;
  90. case 2:
  91. printf("%s\n", "Peer to peer");
  92. break;
  93. case 4:
  94. printf("%s\n", "Mixed");
  95. break;
  96. case 8:
  97. printf("%s\n", "Hybrid");
  98. break;
  99. default:
  100. printf("\n");
  101. }
  102. printf("\tNetBIOS Scope ID: %s\n", pFixedInfo->ScopeId);
  103. if (pFixedInfo->EnableRouting)
  104. printf("\tIP Routing Enabled: Yes\n");
  105. else
  106. printf("\tIP Routing Enabled: No\n");
  107. if (pFixedInfo->EnableProxy)
  108. printf("\tWINS Proxy Enabled: Yes\n");
  109. else
  110. printf("\tWINS Proxy Enabled: No\n");
  111. if (pFixedInfo->EnableDns)
  112. printf("\tNetBIOS Resolution Uses DNS: Yes\n");
  113. else
  114. printf("\tNetBIOS Resolution Uses DNS: No\n");
  115. }
  116. /* Free allocated memory no longer needed */
  117. if (pFixedInfo) {
  118. FREE(pFixedInfo);
  119. pFixedInfo = NULL;
  120. }
  121. printf("------------------------\n");
  122. printf("This is GetAdaptersInfo\n");
  123. printf("------------------------\n");
  124. pAdapterInfo = (IP_ADAPTER_INFO *)MALLOC(sizeof(IP_ADAPTER_INFO));
  125. if (pAdapterInfo == NULL) {
  126. printf("Error allocating memory needed to call GetAdapterInfo\n");
  127. return 1;
  128. }
  129. ulOutBufLen = sizeof(IP_ADAPTER_INFO);
  130. if (GetAdaptersInfo(pAdapterInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW) {
  131. FREE(pAdapterInfo);
  132. pAdapterInfo = (IP_ADAPTER_INFO *)MALLOC(ulOutBufLen);
  133. if (pAdapterInfo == NULL) {
  134. printf("Error allocating memory needed to call GetAdapterInfo\n");
  135. return 1;
  136. }
  137. }
  138. if ((dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen)) != NO_ERROR) {
  139. printf("GetAdaptersInfo failed with error %d\n", dwRetVal);
  140. if (pAdapterInfo)
  141. FREE(pAdapterInfo);
  142. return 1;
  143. }
  144. pAdapter = pAdapterInfo;
  145. while (pAdapter) {
  146. printf("\tAdapter Name: \t%s\n", pAdapter->AdapterName);
  147. printf("\tAdapter Desc: \t%s\n", pAdapter->Description);
  148. printf("\tAdapter Addr: \t");
  149. for (i = 0; i < (int)pAdapter->AddressLength; i++) {
  150. if (i == (pAdapter->AddressLength - 1))
  151. printf("%.2X\n", (int)pAdapter->Address[i]);
  152. else
  153. printf("%.2X-", (int)pAdapter->Address[i]);
  154. }
  155. printf("\tIP Address: \t%s\n",
  156. pAdapter->IpAddressList.IpAddress.String);
  157. printf("\tIP Mask: \t%s\n", pAdapter->IpAddressList.IpMask.String);
  158. printf("\tGateway: \t%s\n", pAdapter->GatewayList.IpAddress.String);
  159. printf("\t***\n");
  160. if (pAdapter->DhcpEnabled) {
  161. printf("\tDHCP Enabled: \tYes\n");
  162. printf("\tDHCP Server: \t%s\n",
  163. pAdapter->DhcpServer.IpAddress.String);
  164. printf("\tLease Obtained: ");
  165. /* Display local time */
  166. error = _localtime32_s(&newtime, (__time32_t*)&pAdapter->LeaseObtained);
  167. if (error)
  168. printf("\tInvalid Argument to _localtime32_s\n");
  169. else {
  170. // Convert to an ASCII representation
  171. error = asctime_s(buffer, 32, &newtime);
  172. if (error)
  173. printf("Invalid Argument to asctime_s\n");
  174. else
  175. /* asctime_s returns the string terminated by \n\0 */
  176. printf("%s", buffer);
  177. }
  178. printf("\tLease Expires: ");
  179. error = _localtime32_s(&newtime, (__time32_t*)&pAdapter->LeaseExpires);
  180. if (error)
  181. printf("Invalid Argument to _localtime32_s\n");
  182. else {
  183. // Convert to an ASCII representation
  184. error = asctime_s(buffer, 32, &newtime);
  185. if (error)
  186. printf("Invalid Argument to asctime_s\n");
  187. else
  188. /* asctime_s returns the string terminated by \n\0 */
  189. printf("%s", buffer);
  190. }
  191. }
  192. else
  193. printf("\tDHCP Enabled: \tNo\n");
  194. if (pAdapter->HaveWins) {
  195. printf("\tHave Wins: \tYes\n");
  196. printf("\tPrimary Wins Server: \t%s\n",
  197. pAdapter->PrimaryWinsServer.IpAddress.String);
  198. printf("\tSecondary Wins Server: \t%s\n",
  199. pAdapter->SecondaryWinsServer.IpAddress.String);
  200. }
  201. else
  202. printf("\tHave Wins: \tNo\n");
  203. printf("\n");
  204. pAdapter = pAdapter->Next;
  205. }
  206. printf("------------------------\n");
  207. printf("This is GetInterfaceInfo\n");
  208. printf("------------------------\n");
  209. pInterfaceInfo = (IP_INTERFACE_INFO *)MALLOC(sizeof(IP_INTERFACE_INFO));
  210. if (pInterfaceInfo == NULL) {
  211. printf("Error allocating memory needed to call GetInterfaceInfo\n");
  212. return 1;
  213. }
  214. ulOutBufLen = sizeof(IP_INTERFACE_INFO);
  215. if (GetInterfaceInfo(pInterfaceInfo, &ulOutBufLen) ==
  216. ERROR_INSUFFICIENT_BUFFER) {
  217. FREE(pInterfaceInfo);
  218. pInterfaceInfo = (IP_INTERFACE_INFO *)MALLOC(ulOutBufLen);
  219. if (pInterfaceInfo == NULL) {
  220. printf("Error allocating memory needed to call GetInterfaceInfo\n");
  221. return 1;
  222. }
  223. printf("\t The size needed for the output buffer ulLen = %ld\n",
  224. ulOutBufLen);
  225. }
  226. if ((dwRetVal = GetInterfaceInfo(pInterfaceInfo, &ulOutBufLen)) == NO_ERROR) {
  227. printf("\tNum Adapters: %ld\n\n", pInterfaceInfo->NumAdapters);
  228. for (i = 0; i < (unsigned int)pInterfaceInfo->NumAdapters; i++) {
  229. printf("\tAdapter Index[%d]: %ld\n", i,
  230. pInterfaceInfo->Adapter[i].Index);
  231. printf("\tAdapter Name[%d]: %ws\n\n", i,
  232. pInterfaceInfo->Adapter[i].Name);
  233. }
  234. printf("GetInterfaceInfo call succeeded.\n");
  235. }
  236. else {
  237. LPVOID lpMsgBuf = NULL;
  238. if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwRetVal, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
  239. (LPTSTR)& lpMsgBuf, 0, NULL)) {
  240. printf("\tError: %s", lpMsgBuf);
  241. }
  242. LocalFree(lpMsgBuf);
  243. }
  244. /* If DHCP enabled, release and renew the IP address */
  245. /* THIS WORKS BUT IT TAKES A LONG TIME AND INTERRUPTS NET CONNECTIONS */
  246. if (pAdapterInfo->DhcpEnabled && pInterfaceInfo->NumAdapters) {
  247. printf("Calling IpReleaseAddress for Adapter[%d]\n", 0);
  248. if ((dwRetVal =
  249. IpReleaseAddress(&pInterfaceInfo->Adapter[0])) == NO_ERROR) {
  250. printf("Ip Release succeeded.\n");
  251. }
  252. if ((dwRetVal =
  253. IpRenewAddress(&pInterfaceInfo->Adapter[0])) == NO_ERROR) {
  254. printf("Ip Renew succeeded.\n");
  255. }
  256. }
  257. /* Free allocated memory no longer needed */
  258. if (pAdapterInfo) {
  259. FREE(pAdapterInfo);
  260. pAdapterInfo = NULL;
  261. }
  262. if (pInterfaceInfo) {
  263. FREE(pInterfaceInfo);
  264. pInterfaceInfo = NULL;
  265. }
  266. printf("----------------------\n");
  267. printf("This is GetIpAddrTable\n");
  268. printf("----------------------\n");
  269. pIPAddrTable = (MIB_IPADDRTABLE *)MALLOC(sizeof(MIB_IPADDRTABLE));
  270. if (pIPAddrTable == NULL) {
  271. printf("Error allocating memory needed to call GetIpAddrTable\n");
  272. return 1;
  273. }
  274. dwSize = 0;
  275. IPAddr.S_un.S_addr = ntohl(pIPAddrTable->table[1].dwAddr);
  276. strIPAddr = inet_ntoa(IPAddr);
  277. if (GetIpAddrTable(pIPAddrTable, &dwSize, 0) == ERROR_INSUFFICIENT_BUFFER) {
  278. FREE(pIPAddrTable);
  279. pIPAddrTable = (MIB_IPADDRTABLE *)MALLOC(dwSize);
  280. if (pIPAddrTable == NULL) {
  281. printf("Error allocating memory needed to call GetIpAddrTable\n");
  282. return 1;
  283. }
  284. }
  285. if ((dwRetVal = GetIpAddrTable(pIPAddrTable, &dwSize, 0)) != NO_ERROR) {
  286. printf("GetIpAddrTable failed with error %d\n", dwRetVal);
  287. if (pIPAddrTable)
  288. FREE(pIPAddrTable);
  289. return 1;
  290. }
  291. printf("\tNum Entries: %ld\n", pIPAddrTable->dwNumEntries);
  292. for (i = 0; i < (unsigned int)pIPAddrTable->dwNumEntries; i++) {
  293. printf("\n\tInterface Index[%d]:\t%ld\n", i,
  294. pIPAddrTable->table[i].dwIndex);
  295. IPAddr.S_un.S_addr = (u_long)pIPAddrTable->table[i].dwAddr;
  296. printf("\tIP Address[%d]: \t%s\n", i, inet_ntoa(IPAddr));
  297. IPAddr.S_un.S_addr = (u_long)pIPAddrTable->table[i].dwMask;
  298. printf("\tSubnet Mask[%d]: \t%s\n", i, inet_ntoa(IPAddr));
  299. IPAddr.S_un.S_addr = (u_long)pIPAddrTable->table[i].dwBCastAddr;
  300. printf("\tBroadCast[%d]: \t%s (%ld%)\n", i, inet_ntoa(IPAddr),
  301. pIPAddrTable->table[i].dwBCastAddr);
  302. printf("\tReassembly size[%d]:\t%ld\n", i,
  303. pIPAddrTable->table[i].dwReasmSize);
  304. printf("\tAddress Index[%d]: \t%ld\n", i,
  305. pIPAddrTable->table[i].dwIndex);
  306. printf("\tType and State[%d]:", i);
  307. if (pIPAddrTable->table[i].wType & MIB_IPADDR_PRIMARY)
  308. printf("\tPrimary IP Address");
  309. if (pIPAddrTable->table[i].wType & MIB_IPADDR_DYNAMIC)
  310. printf("\tDynamic IP Address");
  311. if (pIPAddrTable->table[i].wType & MIB_IPADDR_DISCONNECTED)
  312. printf("\tAddress is on disconnected interface");
  313. if (pIPAddrTable->table[i].wType & MIB_IPADDR_DELETED)
  314. printf("\tAddress is being deleted");
  315. if (pIPAddrTable->table[i].wType & MIB_IPADDR_TRANSIENT)
  316. printf("\tTransient address");
  317. printf("net adapter--------------------------------------------------------------");
  318. printf("\n");
  319. }
  320. iaIPAddress = inet_addr("192.168.1.177");
  321. imIPMask = inet_addr("255.255.255.0");
  322. NTEContext = 0;
  323. NTEInstance = 0;
  324. if ((dwRetVal = AddIPAddress(iaIPAddress,
  325. imIPMask,
  326. pIPAddrTable->table[0].
  327. dwIndex,
  328. &NTEContext, &NTEInstance)) != NO_ERROR) {
  329. LPVOID lpMsgBuf;
  330. printf("\tError adding IP address.\n");
  331. if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwRetVal, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
  332. (LPTSTR)& lpMsgBuf, 0, NULL)) {
  333. printf("\tError: %s", lpMsgBuf);
  334. }
  335. LocalFree(lpMsgBuf);
  336. }
  337. if ((dwRetVal = DeleteIPAddress(NTEContext)) != NO_ERROR) {
  338. printf("DeleteIPAddress failed with error %d\n", dwRetVal);
  339. }
  340. /* Free allocated memory no longer needed */
  341. if (pIPAddrTable) {
  342. FREE(pIPAddrTable);
  343. pIPAddrTable = NULL;
  344. }
  345. printf("-------------------------\n");
  346. printf("This is GetIPStatistics()\n");
  347. printf("-------------------------\n");
  348. pStats = (MIB_IPSTATS *)MALLOC(sizeof(MIB_IPSTATS));
  349. if (pStats == NULL) {
  350. printf("Error allocating memory needed to call GetIpStatistics\n");
  351. return 1;
  352. }
  353. if ((dwRetVal = GetIpStatistics(pStats)) != NO_ERROR) {
  354. printf("GetIPStatistics failed with error %d\n", dwRetVal);
  355. if (pStats)
  356. FREE(pStats);
  357. return 1;
  358. }
  359. printf("\tNumber of IP addresses: %ld\n", pStats->dwNumAddr);
  360. printf("\tNumber of Interfaces: %ld\n", pStats->dwNumIf);
  361. printf("\tReceives: %ld\n", pStats->dwInReceives);
  362. printf("\tOut Requests: %ld\n", pStats->dwOutRequests);
  363. printf("\tRoutes: %ld\n", pStats->dwNumRoutes);
  364. printf("\tTimeout Time: %ld\n", pStats->dwReasmTimeout);
  365. printf("\tIn Delivers: %ld\n", pStats->dwInDelivers);
  366. printf("\tIn Discards: %ld\n", pStats->dwInDiscards);
  367. printf("\tTotal In: %ld\n", pStats->dwInDelivers + pStats->dwInDiscards);
  368. printf("\tIn Header Errors: %ld\n", pStats->dwInHdrErrors);
  369. /* Free allocated memory no longer needed */
  370. if (pStats) {
  371. FREE(pStats);
  372. pStats = NULL;
  373. }
  374. printf("-------------------------\n");
  375. printf("This is GetTCPStatistics()\n");
  376. printf("-------------------------\n");
  377. pTCPStats = (MIB_TCPSTATS *)MALLOC(sizeof(MIB_TCPSTATS));
  378. if (pTCPStats == NULL) {
  379. printf("Error allocating memory needed to call GetTcpStatistics\n");
  380. return 1;
  381. }
  382. if ((dwRetVal = GetTcpStatistics(pTCPStats)) != NO_ERROR) {
  383. printf("GetTcpStatistics failed with error %d\n", dwRetVal);
  384. if (pTCPStats)
  385. FREE(pTCPStats);
  386. return 1;
  387. }
  388. printf("\tActive Opens: %ld\n", pTCPStats->dwActiveOpens);
  389. printf("\tPassive Opens: %ld\n", pTCPStats->dwPassiveOpens);
  390. printf("\tSegments Recv: %ld\n", pTCPStats->dwInSegs);
  391. printf("\tSegments Xmit: %ld\n", pTCPStats->dwOutSegs);
  392. printf("\tTotal # Conxs: %ld\n", pTCPStats->dwNumConns);
  393. /* Free allocated memory no longer needed */
  394. if (pTCPStats) {
  395. FREE(pTCPStats);
  396. pTCPStats = NULL;
  397. }
  398. system("pause");
  399. printf("结束程序.......");
  400. return 0;
  401. }

 

如果编译过程中报错;

在项目属性——预编译器中添加宏

_WINSOCK_DEPRECATED_NO_WARNINGS

然后就大吉大利了。

看看运行结果:

  1. ------------------------
  2. This is GetNetworkParams
  3. ------------------------
  4. Host Name: SD-20190725FZOP
  5. Domain Name:
  6. DNS Servers:
  7. 8.8.8.8
  8. 114.114.114.114
  9. Node Type: Hybrid
  10. NetBIOS Scope ID:
  11. IP Routing Enabled: No
  12. WINS Proxy Enabled: No
  13. NetBIOS Resolution Uses DNS: No
  14. ------------------------
  15. This is GetAdaptersInfo
  16. ------------------------
  17. Adapter Name: {B7615724-E24D-493A-82D4-221DFDA9D91B}
  18. Adapter Desc: Realtek PCIe GBE Family Controller
  19. Adapter Addr: 6C-4B-90-12-95-D2
  20. IP Address: 192.168.1.177
  21. IP Mask: 255.255.255.0
  22. Gateway: 192.168.1.1
  23. ***
  24. DHCP Enabled: No
  25. Have Wins: No
  26. Adapter Name: {02DCE4E6-A0FF-48DC-8514-9CFE266EAA73}
  27. Adapter Desc: TAP-Windows Adapter V9
  28. Adapter Addr: 00-FF-02-DC-E4-E6
  29. IP Address: 10.8.0.10
  30. IP Mask: 255.255.255.252
  31. Gateway: 0.0.0.0
  32. ***
  33. DHCP Enabled: Yes
  34. DHCP Server: 10.8.0.9
  35. Lease Obtained: Mon Dec 30 17:47:27 2019
  36. Lease Expires: Tue Mar 24 03:11:08 2037
  37. Have Wins: No
  38. ------------------------
  39. This is GetInterfaceInfo
  40. ------------------------
  41. The size needed for the output buffer ulLen = 3132
  42. Num Adapters: 2
  43. Adapter Index[0]: 13
  44. Adapter Name[0]: \DEVICE\TCPIP_{B7615724-E24D-493A-82D4-221DFDA9D91B}
  45. Adapter Index[1]: 5
  46. Adapter Name[1]: \DEVICE\TCPIP_{02DCE4E6-A0FF-48DC-8514-9CFE266EAA73}
  47. GetInterfaceInfo call succeeded.
  48. ----------------------
  49. This is GetIpAddrTable
  50. ----------------------
  51. Num Entries: 3
  52. Interface Index[0]: 13
  53. IP Address[0]: 192.168.1.177
  54. Subnet Mask[0]: 255.255.255.0
  55. BroadCast[0]: 1.0.0.0 (1)
  56. Reassembly size[0]: 65535
  57. Address Index[0]: 13
  58. Type and State[0]: Primary IP Addressnet adapter--------------------------------------------------------------
  59. Interface Index[1]: 1
  60. IP Address[1]: 127.0.0.1
  61. Subnet Mask[1]: 255.0.0.0
  62. BroadCast[1]: 1.0.0.0 (1)
  63. Reassembly size[1]: 65535
  64. Address Index[1]: 1
  65. Type and State[1]: Primary IP Addressnet adapter--------------------------------------------------------------
  66. Interface Index[2]: 5
  67. IP Address[2]: 10.8.0.10
  68. Subnet Mask[2]: 255.255.255.252
  69. BroadCast[2]: 1.0.0.0 (1)
  70. Reassembly size[2]: 65535
  71. Address Index[2]: 5
  72. Type and State[2]: Primary IP Address Dynamic IP Addressnet adapter--------------------------------------------------------------
  73. Error adding IP address.
  74. DeleteIPAddress failed with error 1168
  75. -------------------------
  76. This is GetIPStatistics()
  77. -------------------------
  78. Number of IP addresses: 18
  79. Number of Interfaces: 3
  80. Receives: 1071079
  81. Out Requests: 916361
  82. Routes: 15
  83. Timeout Time: 60
  84. In Delivers: 1062655
  85. In Discards: 46951
  86. Total In: 1109606
  87. In Header Errors: 0
  88. -------------------------
  89. This is GetTCPStatistics()
  90. -------------------------
  91. Active Opens: 56926
  92. Passive Opens: 6082
  93. Segments Recv: 1517404
  94. Segments Xmit: 1313639
  95. Total # Conxs: 200
  96. 请按任意键继续. . .
  97. 结束程序.......

 

貌似基本想要看到的信息都拿到了。

如果需要更多,可以参照微软官方的说明文档进行操作。

 

 

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/191386
推荐阅读
相关标签
  

闽ICP备14008679号