gpt-3.5-turbo-0613· openai
Suzhen/CodeChat
C# get resolution size in x and y
- User
C# get resolution size in x and y
- Assistant
You can use the
Screenclass in C# to get the resolution size in x and y. Here's an example:using System; using System.Windows.Forms; class Program { static void Main() { int screenWidth = Screen.PrimaryScreen.Bounds.Width; int screenHeight = Screen.PrimaryScreen.Bounds.Height; Console.WriteLine("Resolution: {0} x {1}", screenWidth, screenHeight); } }This code retrieves the primary screen's resolution size and displays it in the console.