#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <pdh.h>
#include <pdhmsg.h>
#pragma comment(lib, "pdh.lib")
CONST ULONG SAMPLE_INTERVAL_MS = 1000;
CONST PWSTR BROWSE_DIALOG_CAPTION = L"Select a counter to monitor.";
void wmain(void)
{
PDH_STATUS Status;
HQUERY Query = NULL;
HCOUNTER Counter;
PDH_FMT_COUNTERVALUE DisplayValue;
DWORD CounterType;
SYSTEMTIME SampleTime;
PDH_BROWSE_DLG_CONFIG BrowseDlgData;//----Intel[R] Centrino[R] Wireless-N 100-----
WCHAR CounterPathBuffer[PDH_MAX_COUNTER_PATH]=
L"\\Network Interface(Intel[R] Centrino[R] Wireless-N 100)\\Bytes Received/sec";
//
// Create a query.
//
Status = PdhOpenQuery(NULL, NULL, &Query);
if (Status != ERROR_SUCCESS)
{
wprintf(L"\nPdhOpenQuery failed with status 0x%x.",
PDH获取指定网卡速度
最新推荐文章于 2021-10-16 10:39:52 发布