Retrive Hardware configuration

  • Thread starter Thread starter sonu
  • Start date Start date
S

sonu

How can i get the system configuration of Client's Machine Like
infoemation about Hard disk, RAM...
 
Ollie,
Thanks for information but i am using code like this..


ObjectQuery objectQuery = new ObjectQuery("select * from
Win32_Processor");
ManagementObjectSearcher searcher =
new
ManagementObjectSearcher(objectQuery);
foreach (ManagementObject share in
searcher.Get())
{
Response.Write("Share = " +
share["Name"]);
}

Above code is return the information about CPU by using the sql
select * from Win32_Processor

How to find RAM or full hardware information i dont know..

Please Help me
 
i got the properties need out of the script :)

static void Main(string[] args)
{
double totalCapacity = 0;
ObjectQuery objectQuery = new ObjectQuery("select * from
Win32_PhysicalMemory");
ManagementObjectSearcher searcher = new
ManagementObjectSearcher(objectQuery);
ManagementObjectCollection vals = searcher.Get();
foreach(ManagementObject val in vals)
{
totalCapacity += System.Convert.ToDouble(val.GetPropertyValue("Capacity"));
}
Console.WriteLine("Total Machine Memory = " + totalCapacity.ToString() + "
Bytes");
Console.WriteLine("Total Machine Memory = " + (totalCapacity / 1024) + "
KiloBytes");
Console.WriteLine("Total Machine Memory = " + (totalCapacity / 1048576) + "
MegaBytes");
Console.WriteLine("Total Machine Memory = " + (totalCapacity / 1073741824 )
+ " GigaBytes");
Console.ReadLine();
}

HTH

Ollie Riches
 
Back
Top