For the following code, I am getting
System.ComponentModel.Win32Exception: The network path was not found
Can anyone help?
PerformanceCounter pc = new PerformanceCounter("System",
"System Up Time");
pc.MachineName = "1.2.3.4";
//Normally starts with zero. do Next Value always.
pc.NextValue();
TimeSpan ts = TimeSpan.FromSeconds(pc.NextValue());
Response.Write("This system 1.2.3.4 has been up for " + ts.Days + " days " + ts.Hours + " hours, " + ts.Minutes + " and " + ts.Seconds +" seconds.");
Edit: I tried with machine name, and I still get the same error! Note: 1.2.3.4 is a sample value.