Согласно ответу с форума MSDN :
[DllImport("kernel32.dll", SetLastError = true)]
static extern IntPtr GetStdHandle(int nStdHandle);
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool ReadConsoleOutputCharacter(
IntPtr hConsoleOutput,
[Out] StringBuilder lpCharacter,
uint length,
COORD bufferCoord,
out uint lpNumberOfCharactersRead);
[StructLayout(LayoutKind.Sequential)]
public struct COORD
{
public short X;
public short Y;
}
public static char ReadCharacterAt(int x, int y)
{
IntPtr consoleHandle = GetStdHandle(-11);
if (consoleHandle == IntPtr.Zero)
{
return '\0';
}
COORD position = new COORD
{
X = (short)x,
Y = (short)y
};
StringBuilder result = new StringBuilder(1);
uint read = 0;
if (ReadConsoleOutputCharacter(consoleHandle, result, 1, position, out read))
{
return result[0];
}
else
{
return '\0';
}
}
Применительно это выглядит так:
class Program
{
static void Main(string[] args)
{
Console.Clear();
Console.CursorLeft = 0;
Console.CursorTop = 1;
Console.Write("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
char first = ReadCharacterAt(10, 1);
char second = ReadCharacterAt(20, 1);
Console.ReadLine();
}
}