-1

I need the code or the definition of the method getAvailableRam used in C# to find the memory usage of the computer.

prakruti
  • 1
  • 1
  • 1
    See [http://stackoverflow.com/questions/750574/how-to-get-memory-available-or-used-in-c](this post) for more info – Chris O Mar 26 '11 at 13:46
  • 2
    There are no functions in C#, there are methods, every method belongs to a class, and every class belongs to a DLL or an application. Where did you take this method name from? Where does it belong? Who wrote it? – Ilya Kogan Mar 26 '11 at 13:46

1 Answers1

0
class Program
{
    static void Main()
    {
        var ramCounter = new PerformanceCounter("Memory", "Available MBytes");
        Console.WriteLine("{0} Mb", ramCounter.NextValue());
    }
}
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928