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文件,然后晃一下鼠标,屏保程序结束, 但是不知道为什么不行, 屏保会一直都在,知道我手动晃一下鼠标.
请高手看看是什么问题?

解决方案 »

  1.   

    [DllImport("user32.dll",   EntryPoint   =   "SetCursorPos",   CharSet   =   CharSet.Auto)]  
      static   extern   bool   SetCursorPos(int   X,int   Y);
      

  2.   

    就是要退出屏保呗,整那么麻烦干吗      Process process = Process.Start(@"C:\Windows\System32\ssText3d.scr", "/");
          System.Threading.Thread.Sleep(10000);
          process.CloseMainWindow();
      

  3.   

    mmqingfeng(漠漠青峰) ( ) 信誉:99  2007-09-24 18:31:43  得分: 0  
     
     
       就是要退出屏保呗,整那么麻烦干吗      Process process = Process.Start(@"C:\Windows\System32\ssText3d.scr", "/");
          System.Threading.Thread.Sleep(10000);
          process.CloseMainWindow();
      是很简单...我几分钟前也发现了这个方法......
     谢谢!!