using System;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;namespace zConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Process.Start(@"C:\Windows\System32\ssText3d.scr", "/");
Point p1 = new Point(20, 10);
Point p2 = new Point(10, 20);
System.Threading.Thread.Sleep(10000);
Cursor.Position = p1;
Cursor.Position = p2;
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}主要是想运行一下屏幕保护程序,这里是直接执行那个scr文件,然后晃一下鼠标,屏保程序结束, 但是不知道为什么不行, 屏保会一直都在,知道我手动晃一下鼠标.
请高手看看是什么问题?
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;namespace zConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Process.Start(@"C:\Windows\System32\ssText3d.scr", "/");
Point p1 = new Point(20, 10);
Point p2 = new Point(10, 20);
System.Threading.Thread.Sleep(10000);
Cursor.Position = p1;
Cursor.Position = p2;
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}主要是想运行一下屏幕保护程序,这里是直接执行那个scr文件,然后晃一下鼠标,屏保程序结束, 但是不知道为什么不行, 屏保会一直都在,知道我手动晃一下鼠标.
请高手看看是什么问题?
static extern bool SetCursorPos(int X,int Y);
System.Threading.Thread.Sleep(10000);
process.CloseMainWindow();
就是要退出屏保呗,整那么麻烦干吗 Process process = Process.Start(@"C:\Windows\System32\ssText3d.scr", "/");
System.Threading.Thread.Sleep(10000);
process.CloseMainWindow();
是很简单...我几分钟前也发现了这个方法......
谢谢!!