zoukankan      html  css  js  c++  java
  • C#电脑自动关机代码指令

          Process p = new Process();//实例化一个独立进程
                    p.StartInfo.FileName = "cmd.exe";//进程打开的文件为Cmd
                    p.StartInfo.UseShellExecute = false;//是否启动系统外壳选否
                    p.StartInfo.RedirectStandardInput = true;//这是是否从StandardInput输入
                    p.StartInfo.CreateNoWindow = true;//这里是启动程序是否显示窗体
                    p.Start();//启动
                    p.StandardInput.WriteLine("shutdown -s -t 1");//运行关机命令shutdown (-s)是关机 (-t)是延迟的时间 这里用秒计算 10就是10秒后关机
                    p.StandardInput.WriteLine("exit");

  • 相关阅读:
    CF235D
    模拟赛 circle 题解
    平面图总结
    kd 树总结
    思维题
    luogu P1600 天天爱跑步
    UOJ #42. 【清华集训2014】Sum
    FZOJ 4344 连通性
    平衡树
    计蒜客 T3225 Darko 的生成树
  • 原文地址:https://www.cnblogs.com/wyt007/p/6042426.html
Copyright © 2011-2022 走看看