New PerformanceCounter ("Web Service" "CurrentConnections" " Default Web Site","10.1.254.103"); Response.writeline (PC. NextValue ()); Thread.Sleep (+); Response.writeline (PC. NextValue ());
1. Using system.diagnostics required;
2. In the local server to establish a remote host with the same account password, the remote Host account password needs to performance Monitor users and Administrators group;
(You may need to turn on remote host Registry service)
Public PerformanceCounter (String categoryname,string countername,string instancename,string machinename)
- CategoryName
-
Type: System . String
The name of the performance counter category (performance object) associated with this performance counter.
- CounterName
-
Type: System . String
The name of the performance counter.
- InstanceName
-
Type: System . String
The name of the performance counter category instance, or an empty string ("") If the category contains a single instance.
- MachineName
-
Type: System . String
the computer on which the performance counter and its associated categories reside.
C # Read remote host performance counters