RAM

  • Thread starter Thread starter Anders Johansson
  • Start date Start date
A

Anders Johansson

Hi!

Is there any way to check the total RAM memory on the client machine with
C#.

Thanks in advance

Anders
 
Is using WMI ok? If so:

ManagementObjectSearcher mos = new ManagementObjectSearcher();("SELECT
TotalPhysicalMemory FROM Win32_ComputerSystem");
foreach (ManagementObject mo in mos.Get())
{
Console.WriteLine (mo["TotalPhysicalMemory"]);
}

Hi!

Is there any way to check the total RAM memory on the client machine with
C#.

Thanks in advance

Anders
 
Hi Shiva!

I do not find the namespace System.Management where the object
ManagementObjectSearcher exists? Or do I find it somewhere else?

Thanks

Anders
 
Hi!

Yes it helps - thanks!
But it says that I have 802 Mb total physical memory although I just have
784 Mb?

Thanks

Anders
 
Hello Anders,

You have to add a reference to System.Management.dll and import
System.Management namespace

Hi Shiva!

I do not find the namespace System.Management where the object
ManagementObjectSearcher exists? Or do I find it somewhere else?

Thanks

Anders
 
Off course!

Thanks - it works!

Shiva said:
Hello Anders,

You have to add a reference to System.Management.dll and import
System.Management namespace

Hi Shiva!

I do not find the namespace System.Management where the object
ManagementObjectSearcher exists? Or do I find it somewhere else?

Thanks

Anders


Shiva said:
Is using WMI ok? If so:

ManagementObjectSearcher mos = new ManagementObjectSearcher();("SELECT
TotalPhysicalMemory FROM Win32_ComputerSystem");
foreach (ManagementObject mo in mos.Get())
{
Console.WriteLine (mo["TotalPhysicalMemory"]);
}

Hi!

Is there any way to check the total RAM memory on the client machine with
C#.

Thanks in advance

Anders
 
Back
Top