怎么获取这段代码的坐标啊
class kongzhi{
public int x = 5, y = 5;
public string str = "D";
public int i;
public void leftright(int i)
{
Console.SetCursorPosition(i, y);
Console.Write(str);
}
public void updown(int i)
{
Console.SetCursorPosition(x, i);
Console.Write(str);
}
}
class fx
{
public int R1, R2;
public string Str;
public void fangxiang()
{
kongzhi k = new kongzhi();
Str = k.str;
leep1:
switch (Console.ReadKey().Key)
{
case ConsoleKey.LeftArrow: k.x--; k.leftright(k.x); break;
case ConsoleKey.RightArrow: k.x++; k.leftright(k.x); break;
case ConsoleKey.UpArrow: k.y--; k.updown(k.y); break;
case ConsoleKey.DownArrow: k.y++; k.updown(k.y); break;
Console.SetCursorPosition(R1, R2);
}
goto leep1;
}
}
class Program
{
static void Main(string[] args)
{
random y = new random();
fx k1 = new fx();
}
}