日期:2014-05-20  浏览次数:20699 次

如何用代码实现锁定计算机
如何用代码实现锁定计算机
  Process   p   =   new   Process();
  p.StartInfo.FileName   =   "rundll32.exe   user32.dll,LockWorkStation ";
  p.Start();    
运行后报找不到文件??请大家帮忙看看

------解决方案--------------------


Process p = new Process();
p.StartInfo.FileName = "rundll32.exe ";
p.StartInfo.Arguments = "user32.dll, LockWorkStation ";
p.Start();


------解决方案--------------------
Process p = new Process();
p.StartInfo.WorkingDirectory = "c:\\windows\\system32 ";
p.StartInfo.FileName = "rundll32.exe ";
p.StartInfo.Arguments= "user32.dll,LockWorkStation ";
p.Start();

测试通过~