Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Retrive Hardware configuration

19 views
Skip to first unread message

sonu

unread,
Sep 8, 2005, 3:52:08 PM9/8/05
to
How can i get the system configuration of Client's Machine Like
infoemation about Hard disk, RAM...

Ollie Riches

unread,
Sep 9, 2005, 5:50:16 AM9/9/05
to
you can use WMI and the System.Management namespace

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemmanagement.asp

http://msdn.microsoft.com/msdnmag/issues/02/05/WMIMan/

An article demostrating what you want:

http://www.codeproject.com/vbscript/VvvHardwareInfo.asp

HTH

Ollie Riches

"sonu" <kr_a...@yahoo.com> wrote in message
news:1126209128....@g47g2000cwa.googlegroups.com...

ż Mahesh Kumar

unread,
Sep 9, 2005, 6:04:07 AM9/9/05
to
Hi sonu,

Try the followin classes and links below to further research over this.

Driveinfo,Getdrives, Getdriveinfo,Drivetype etc..
(1) http://msdn2.microsoft.com/en-us/library/0fxtk2z5
(2) http://msdn2.microsoft.com/en-us/library/k22c1a85(en-us,vs.80).aspx

Hope this will atleast start your search :)

Maheshkumar.R
http://spaces.msn.com/members/cyberiafreak

"sonu" <kr_a...@yahoo.com> wrote in message
news:1126209128....@g47g2000cwa.googlegroups.com...

sonu

unread,
Sep 9, 2005, 10:39:31 AM9/9/05
to
Is there any method in System.Management for getting the information
about RAM,and CPU

Ollie Riches

unread,
Sep 9, 2005, 10:50:26 AM9/9/05
to
it is all in the demo at:

http://www.codeproject.com/vbscript/VvvHardwareInfo.asp

Ollie Riches

"sonu" <kr_a...@yahoo.com> wrote in message

news:1126276771.0...@g49g2000cwa.googlegroups.com...


Is there any method in System.Management for getting the information
about RAM,and CPU

sonu

unread,
Sep 9, 2005, 11:05:00 AM9/9/05
to
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

Ollie Riches

unread,
Sep 9, 2005, 11:49:20 AM9/9/05
to
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

"sonu" <kr_a...@yahoo.com> wrote in message

news:1126278300.7...@f14g2000cwb.googlegroups.com...

sonu

unread,
Sep 9, 2005, 12:08:59 PM9/9/05
to
Thanks Ollie

Its working fine, thank you very much

0 new messages