<span style="color:#0000ff; font-size:x-small <span style="color:#0000ff; font-size:x-small
Hi, Below is the code sample - works on XP but fails on Windows Server 2008. Throws Invalid Class Exception. Is this class supported on Windows 2008? Appreciate your help. Thanks.
<font size="2" color="#0000ff <font size="2" color="#0000ff
string scope = @"rootcimv2";<br/>
string query = @"select * from Win32_PerfRawData_Tcpip_TCP";<br/>
UInt32 connFailed = 0;<br/>
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);<br/>
try<br/>
{<br/>
foreach (ManagementObject obj in searcher.Get())<br/>
{<br/>
connFailed = System.Convert.ToUInt32(obj.Properties["ConnectionFailures"].Value);<br/>
}<br/>
} <br/>
catch (Exception e)<br/>
{<br/>
MessageBox.Show(e.ToString());<br/>
}
</font></font><font size="2" color="#0000ff
</font>
View the full article
Hi, Below is the code sample - works on XP but fails on Windows Server 2008. Throws Invalid Class Exception. Is this class supported on Windows 2008? Appreciate your help. Thanks.
<font size="2" color="#0000ff <font size="2" color="#0000ff
string scope = @"rootcimv2";<br/>
string query = @"select * from Win32_PerfRawData_Tcpip_TCP";<br/>
UInt32 connFailed = 0;<br/>
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);<br/>
try<br/>
{<br/>
foreach (ManagementObject obj in searcher.Get())<br/>
{<br/>
connFailed = System.Convert.ToUInt32(obj.Properties["ConnectionFailures"].Value);<br/>
}<br/>
} <br/>
catch (Exception e)<br/>
{<br/>
MessageBox.Show(e.ToString());<br/>
}
</font></font><font size="2" color="#0000ff
</font>
View the full article