C#简单获取全屏中鼠标焦点位置坐标的方法示例
作者:a771948524 时间:2023-09-14 16:18:04
本文实例讲述了C#简单获取全屏中鼠标焦点位置坐标的方法。分享给大家供大家参考,具体如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Threading;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
///获取桌面大小
//Rectangle rect = System.Windows.Forms.SystemInformation.VirtualScreen;
//int width = rect.Width;
//int height = rect.Height;
///循环取点
while (true) {
Point p = System.Windows.Forms.Cursor.Position;
Console.WriteLine(p.X + ":" + p.Y);
Thread.Sleep(100);
Console.Clear();
}
}
}
}
希望本文所述对大家C#程序设计有所帮助。
标签:C#,鼠标,坐标
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
深入理解C#窗体关闭事件
2023-06-01 14:38:56
![](https://img.aspxhome.com/file/2023/7/122637_0s.jpg)
Android SDK在线更新镜像服务器大全
2023-03-14 05:44:27
![](https://img.aspxhome.com/file/2023/8/103878_0s.jpg)
Java 堆内存溢出原因分析
2023-06-27 08:34:23
![](https://img.aspxhome.com/file/2023/6/72626_0s.png)
go语言题解LeetCode88合并两个有序数组示例
2023-10-23 00:55:10
springboot+mybatis配置控制台打印sql日志的方法
2023-12-15 15:40:55
![](https://img.aspxhome.com/file/2023/0/97940_0s.jpg)
C#中单例模式的三种写法示例
2023-05-04 19:28:25
Android开发之DialogFragment用法实例总结
2023-08-30 13:20:21
使用Java读取Word文件的简单例子分享
2022-12-17 02:15:19
![](https://img.aspxhome.com/file/2023/8/87358_0s.png)
安卓GreenDao框架一些进阶用法整理
2023-06-17 03:27:21
C和指针小结(推荐)
2022-11-08 09:17:08
![](https://img.aspxhome.com/file/2023/7/127527_0s.png)
java中重载,继承,重写和多态的区别
2022-05-06 06:40:16
解决@JsonInclude(JsonInclude.Include.NON_NULL)不起作用问题
2023-05-26 08:57:45
![](https://img.aspxhome.com/file/2023/0/67470_0s.png)
Android getevent用法实例详解
2021-06-27 10:03:35
C#设置Word文档背景的三种方法(纯色/渐变/图片背景)
2022-07-08 01:33:09
![](https://img.aspxhome.com/file/2023/0/67560_0s.jpg)
Android贝塞尔曲线初步学习第二课 仿QQ未读消息气泡拖拽黏连效果
2023-08-18 10:18:20
![](https://img.aspxhome.com/file/2023/4/120174_0s.gif)
Java String类简单用法实战示例【字符串输出、比较】
2021-09-22 11:59:51
C++智能指针实例详解
2021-12-18 00:38:59
Kotlin协程launch启动流程原理详解
2021-10-31 15:47:22
Windows下Flutter+Idea环境搭建及配置
2022-01-22 18:12:13
![](https://img.aspxhome.com/file/2023/3/114333_0s.jpg)
Java 数据结构深入理解ArrayList与顺序表
2023-02-15 14:24:07
![](https://img.aspxhome.com/file/2023/1/62501_0s.png)