#region 自动关机方法1
[DllImport("user32.dll", EntryPoint = "ExitWindowsEx", CharSet = CharSet.Ansi)]
private static extern int ExitWindowsEx(int uFlags, int dwReserved);
public static void M_AutoClose()
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "cmd.exe";///获取或设置要启动的应用程序或文档
//process.StartInfo.Arguments = "shutdown /s /t 60";
process.StartInfo.UseShellExecute = false;///是否使用操作系统的外壳程序启动进程
process.StartInfo.RedirectStandardInput = true;///应用程序的出入是否从System.Diagnostics.Process.StartInfo.RedirectStandardInput流中读取