网上说的基本都是:
host.SendMouseClickEvent(x, y, MouseButtonType.Left, false, 1, CefEventFlags.None);//按下鼠标左键 Thread.Sleep(50); host.SendMouseClickEvent(x, y, MouseButtonType.Left, true, 1, CefEventFlags.None);//松开鼠标左键
但现实如下:
var host = browser.GetHost(); var x = Convert.ToInt32(left) + 5; var y = Convert.ToInt32(top) + 5; host.SendMouseMoveEvent(x, y, false, CefEventFlags.None);//移动鼠标 Thread.Sleep(50); host.SendMouseClickEvent(x, y, MouseButtonType.Left, false, 1, CefEventFlags.None);//按下鼠标左键 Thread.Sleep(50); host.SendMouseClickEvent(x, y, MouseButtonType.Left, true, 1, CefEventFlags.None);//松开鼠标左键
评论区