0
我嘗試在c#中創建一個performanceCounter用於監視我的瀏覽器的網絡連接;.NET CLR Networking 4.0.0.0 - >創建性能計數器
當我顯示的列表中找到我的瀏覽器實例名,這不是由CounterPerformance」 .NET CLR網絡4.0.0.0" 監控...
創建我的計數器:
bytesSent = new PerformanceCounter();
bytesSent.CategoryName = ".NET CLR Networking 4.0.0.0";
bytesSent.CounterName = "Bytes Sent";
bytesSent.InstanceName = instanceName; // instanceName of my browser.
bytesSent.ReadOnly = true;
我監測顯示實例列表:
PerformanceCounterCategory category = new PerformanceCounterCategory(".NET CLR Networking 4.0.0.0");
string[] listMonitoredApplication = category.GetInstanceNames();
foreach (string monitoredInstanceName in listMonitoredApplication)
{
Console.WriteLine(" - " + monitoredInstanceName);
}
我顯示的PerformanceCounter的列表中的每1秒,然後在列表中有剛:
- myApplicationInstanceName
- _global_
你有什麼想法,爲什麼我的瀏覽器PerformanceCounter沒有創建?
謝謝。
好的,謝謝你的解釋! 您是否知道,如果我想用其他解決方案檢測瀏覽器網絡監控?我實際上搜索Netsh trace的解決方案,但如果您有更好的解決方案,我很感興趣! :-) –