The value is stored in the registry
For XP it's at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI LogPixels
You could create a Graphics object from the console window handle:
using (Graphics g = Graphics.FromHwnd(Process.GetCurrentProcess().MainWindowHandle)) {
Console.WriteLine("X {0:F0}dpi, Y {1:F0}dpi", g.DpiX, g.DpiY);
}
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\WindowsNT\CurrentVersion\FontDPI")) {
Console.WriteLine(key.GetValue("LogPixels"));
}
Alan.