代码参考:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
using static WindowsFormsApp1.GlobalMousePosition;
namespace 测试Demo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.TopMost = true;
}
private async void button1_Click(object sender, EventArgs e)
{
int time = 300;
//模拟点击
SimulateMouseClick(666, 666);
await SetText("2023-06-20");
Thread.Sleep(time);
//发送Alt+Q
SendKeys.Send("%Q");
Thread.Sleep(time);
Send_CV();
Release_CV()

该代码示例展示了如何在C#WindowsForms应用程序中模拟鼠标点击、键盘输入以及剪贴板操作。它使用`SendKeys`类发送键盘事件,如Alt+Q和回车键,并使用`keybd_event`模拟Ctrl+V操作。此外,还包含了一个低级鼠标钩子来获取鼠标位置并进行模拟点击。
最低0.47元/天 解锁文章
8176





