C#程序,长时间不操作,能否自动关闭?求代码 大哥们,C#程序,长时间不操作,能否判断系统长时间不操作,写代码让系统自动关闭? 有代码么?谢谢了阿 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 WINFORM? 貌似没有哦,所有操作都要改动,都要更新已操作,貌似没有直接判断的解决方法 Process p = new Process(); p.StartInfo.FileName = "cmd.exe"; p.StartInfo.CreateNoWindow = true; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardError = true; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.Start(); p.StandardInput.WriteLine("shutdown -s -t 60"); p.StandardInput.WriteLine("exit");注意,运行以上代码前先保存好数据,60秒后将关机。 http://hi.baidu.com/jackeyrain/blog/item/367e9d2c2ac5c0eb8a1399b4.html参考。 http://topic.csdn.net/u/20081212/14/3f8fc2b9-1d75-4300-8c67-748edb46bf23.html参考 求教一个面试题目 winForm主菜单和快捷菜单一模一样需要建两个菜单吗? 请问一个多客户端数据库插入问题。 窗体间传参 WINDOWS 应用程序里 怎么访问或得到asp或aspx的数据 请教,关于三楼楼主的OA系统安装问题 如保用ArrayList存储一个二维数组??? treeview绑定到数据库,我如何得到选定节点的ID值 winform 透明遮罩 有谁用C#做过较大的项目吗? C# 如何发送消息大winform程序 遍历字符串
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
p.StandardInput.WriteLine("shutdown -s -t 60");
p.StandardInput.WriteLine("exit");注意,运行以上代码前先保存好数据,60秒后将关机。