Displaying System RAM in c#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonny

    Displaying System RAM in c#

    How do I display the system RAM in C# ?? Do I have to get
    it from the Registry or is there a function for it?

    If so how??

    Thanks

    /Jonny
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Displaying System RAM in c#

    Jonny,

    You will want to use the classes in the System.Manageme nt namespace to
    access the WMI providers. Basically, you want to query the system for all
    instances of the Win32_PhysicalM emory WMI class. On that class, there is a
    Capacity property you can use to get the memory for that particular board
    (each instance of the Win32_PhysicalM emory WMI class will represent a
    different memory board).

    Hope this helps.

    --
    - Nicholas Paldino [.NET/C# MVP]
    - nick(dot)paldin o=at=exisconsul ting<dot>com

    "Jonny" <jonathan_schni ttger@hotmail.c om> wrote in message
    news:054a01c38c c2$136c13e0$a00 1280a@phx.gbl.. .[color=blue]
    > How do I display the system RAM in C# ?? Do I have to get
    > it from the Registry or is there a function for it?
    >
    > If so how??
    >
    > Thanks
    >
    > /Jonny[/color]


    Comment

    • Jonny

      #3
      Re: Displaying System RAM in c#

      Thanks Nicholas,

      I keep getting this error when I try to use the
      system.manageme nt

      The type or namespace name 'Management' does not exist in
      the class or namespace 'System' (are you missing an
      assembly reference?)

      any idea's?

      Am i missing something really obvious?

      /Jonny


      [color=blue]
      >-----Original Message-----
      >Jonny,
      >
      > You will want to use the classes in the[/color]
      System.Manageme nt namespace to[color=blue]
      >access the WMI providers. Basically, you want to query[/color]
      the system for all[color=blue]
      >instances of the Win32_PhysicalM emory WMI class. On[/color]
      that class, there is a[color=blue]
      >Capacity property you can use to get the memory for that[/color]
      particular board[color=blue]
      >(each instance of the Win32_PhysicalM emory WMI class[/color]
      will represent a[color=blue]
      >different memory board).
      >
      > Hope this helps.
      >
      >--
      > - Nicholas Paldino [.NET/C# MVP]
      > - nick(dot)[/color]
      paldino=at=exis consulting<dot> com[color=blue]
      >
      >"Jonny" <jonathan_schni ttger@hotmail.c om> wrote in[/color]
      message[color=blue]
      >news:054a01c38 cc2$136c13e0$a0 01280a@phx.gbl. ..[color=green]
      >> How do I display the system RAM in C# ?? Do I have to[/color][/color]
      get[color=blue][color=green]
      >> it from the Registry or is there a function for it?
      >>
      >> If so how??
      >>
      >> Thanks
      >>
      >> /Jonny[/color]
      >
      >
      >.
      >[/color]

      Comment

      Working...