C#, 90 Bytes
()=>{var b=System.Windows.Forms.Screen.PrimaryScreen.Bounds;return b.Width+"x"+b.Height;};
This actually is quite a similiar answer to that one, which already exists, however, I'd like to add a few things. This solution acutally needs a reference to System.Windows.Forms and one to System.Drawing. Those references are not normally added for a console application, so I'm not sure wether it's valid. Therefore I wrote a solution without references, however this has 580 287 Bytes:
using System;using System.Runtime.InteropServices;class P{static void Main()=>Console.Write(G().Item1+"x"+G().Item2);static(int,int)G()=>(GetSystemMetrics(0),GetSystemMetrics(1));[DllImport("User32.dll",ExactSpelling=true,CharSet=CharSet.Auto)]static extern int GetSystemMetrics(int n);}
Here's the solution with line breaks:
using System;
using System.Runtime.InteropServices;
class P
{
static void Main() => Console.Write(G().Item1 + "x" + G().Item2);
static (int, int) G() => (GetSystemMetrics(0), GetSystemMetrics(1));
[DllImport("User32.dll", ExactSpelling = true, CharSet = CharSet.Auto)]
static extern int GetSystemMetrics(int n);
}
This solution was created with the huge help of AdamSchiavone on Stackoverflow.
I also wrote a C# Interactive programm with 123 Bytes, which automatically adds the references, so it can be executed on every machine without problems and without having the reference problems:
#r "System.Windows.Forms"
#r "System.Drawing"
var b=System.Windows.Forms.Screen.PrimaryScreen.Bounds;b.Width+"x"+b.Height
This basically is the same as the first one, but it adds the reference automatically and as it is executed in the interactive, you don't need the return statement, you can simply leave away the semicolon.
'0x0'
\$\endgroup\$