public String SystemAction(String command) { if (RunSystemAction.Run(command)) { return(JsonConstructor.SendMessage(true, "成功")); } else { return(JsonConstructor.SendMessage(false, "命令不存在")); } }
private void button6_Click(object sender, EventArgs e) { RunSystemAction.Run("sleep"); }
private void button5_Click(object sender, EventArgs e) { RunSystemAction.Run("hibernate"); }
private void button4_Click(object sender, EventArgs e) { RunSystemAction.Run("logoff"); }
private void button2_Click(object sender, EventArgs e) { RunSystemAction.Run("reboot"); }
private void button1_Click(object sender, EventArgs e) { RunSystemAction.Run("shutdown"); }