1 using System;
 2 using System.Drawing;
 3 using System.Runtime.InteropServices;
 4 using System.Threading;
 5 
 6 namespace ConsoleApplication1
 7 {
 8     class Program
 9     {
10         static void Main(string[] args)
11         {
12             while (true)
13             {
14                 Point point;
15                 GetCursorPos(out point);
16                 Console.WriteLine("x:{0},y:{1}", point.X, point.Y);
17                 Thread.Sleep(1000);
18             }
19         }
20         [DllImport("User32")]
21         public static extern bool GetCursorPos(out Point point);
22     }
23 }

 

相关文章:

  • 2022-01-26
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-30
  • 2021-12-23
  • 2021-11-07
  • 2021-11-07
  • 2021-11-07
相关资源
相似解决方案