How can i get the information that the server is being connected to the network?
If it is connected then who will be get the access (getting the privileges of accessing the system)
Thanks,
Prasad
How can i get the information that the server is being connected to the network?
If it is connected then who will be get the access (getting the privileges of accessing the system)
Thanks,
Prasad
For example take a look at this. This get's RAM and C drive information and also percents of processor working.
DriveInfo[] drives = DriveInfo.GetDrives();
DriveInfo mainDrive = null;
foreach (DriveInfo drive in drives)
{
if (drive.IsReady && drive.Name.ToLower().Equals("c:\\"))
{
mainDrive = drive;
break;
}
}
int totalRamSize = 0;
int freeRamSize = 0;
ManagementObjectSearcher ramSizeFinder = new ManagementObjectSearcher("Select * From Win32_OperatingSystem");
foreach (ManagementObject obj in ramSizeFinder.Get())
{
totalRamSize = Convert.ToInt32(obj["TotalVisibleMemorySize"]);
freeRamSize = Convert.ToInt32(obj["FreePhysicalMemory"]);
}
//PerformanceCounter cpuUsage=new PerformanceCounter("Processor","% Processor Time", "_Total");
int cpuUsage=0;
ManagementObjectSearcher cpuPercentFinder = new ManagementObjectSearcher("Select * From Win32_Processor");
foreach (ManagementObject obj in cpuPercentFinder.Get())
{
cpuUsage = Convert.ToInt32(obj["LoadPercentage"]);
}
Most likely that information can be retreived using WMI (windows management instrumentation)