'Check current display resolution using .NET core Console Application C#

I am using .NET Core 3.1 Console Application C#

How do i check current DISPLAY resolution of windows? (Not a monitor maximum resolution).

I want to make my app with full screen having 1024x768 resolution default.

I don't want to use nircmd and Qres apps for this.

Also I'm not want to get resolution of monitor highest available.

Or

How to set 1024x768 screen resolution using C# console Application?

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {

            Console.WriteLine("Hello World!");
            Console.Read();
        }
    }
}




Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source