C# Program to Get the Memory Size for OS Page File Using Environment Class

You are currently viewing C# Program to Get the Memory Size for OS Page File Using Environment Class

C# program to get the memory size for OS page file using Environment class

using System;

class Sample
{
    //Entry point of Program
    static public void Main()
    {
        int memory = 0;

        memory = Environment.SystemPageSize;
        Console.WriteLine("Amount of memory for an OS page file: " +memory);
    }
}

Output

Amount of memory for an OS page file: 4096
Press any key to continue . . .

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply