private void sendRegResult(BaseCommunication sender, FourCode code) { try { string[] regdirs = BD.Get_Register_Root_Names(code.Body, code.Foot); string[] regkeys = BD.Get_Register_Root_ALLValues(code.Body, code.Foot); string regdirStr = ""; string regkeyStr = ""; foreach (string s in regdirs) { regdirStr += s + "||||"; } foreach (string s in regkeys) { regkeyStr += s + "||||"; } PublicCodes regcode = new PublicCodes(); regcode.Head = CodeHead.SEND_REGINFO; regcode.Msg = regdirStr; regcode.Type = regkeyStr; sender.SendCode(regcode); } catch { } }
public void displayProcessInfoResult(Code code) { PublicCodes info = code as PublicCodes; ProcessMsg = info.Msg; if (info.Type == "All") { PSSMsg = System.Environment.NewLine + "获取所有进程......成功" + System.Environment.NewLine; } if (info.Type == "Kill") { PSSMsg = System.Environment.NewLine + "杀死进程......成功,已刷新" + System.Environment.NewLine; } Process_lV.Invoke(new ListViewPushEvent(AddProcessInfo)); PSS_rTB.Invoke(new RichTextBoxAddEvent(PSSMsgInfo)); }
/// <summary> /// 发送启动项查询结果 /// </summary> /// <param name="sender"></param> /// <param name="code"></param> private void sendStartupInfoResult(BaseCommunication sender, ThreeCode code) { try { PublicCodes info = new PublicCodes(); info.Head = CodeHead.SEND_STARTUPINFO; if (code.Body == "Disabled") { BD.RunWhenStart(false, code.Foot, @"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\"); } info.Msg = BD.StartupInfoList(); info.Type = code.Body; sender.SendCode(info); } catch { } }
public void displayStartupInfoResult(Code code) { PublicCodes info = code as PublicCodes; ProcessMsg = info.Msg; if (info.Type == "All") { PSSMsg = System.Environment.NewLine + "获取所有启动项......成功" + System.Environment.NewLine; } if (info.Type == "Del") { PSSMsg = System.Environment.NewLine + "删除启动项......成功,已刷新" + System.Environment.NewLine; } if (info.Type == "Disabled") { PSSMsg = System.Environment.NewLine + "禁用启动项......成功,已刷新" + System.Environment.NewLine; } Startup_lV.Invoke(new ListViewPushEvent(AddProcessInfo)); PSS_rTB.Invoke(new RichTextBoxAddEvent(PSSMsgInfo)); }
/// <summary> /// 发送进程执行结果 /// </summary> /// <param name="sender"></param> /// <param name="code"></param> private void sendProcessInfoResult(BaseCommunication sender, ThreeCode code) { try { PublicCodes info = new PublicCodes(); info.Head = CodeHead.SEND_PROCESSINFO; if (code.Body == "All") { info.Msg = BD.Get_Process(); info.Type = code.Body; } ; if (code.Body == "Kill") { BD.Kill_Process(code.Foot); info.Msg = BD.Get_Process(); info.Type = code.Body; } sender.SendCode(info); } catch { } }
public void displayServiceInfoResult(Code code) { PublicCodes info = code as PublicCodes; ServiceMsg = info.Msg; if (info.Type == "All") { PSSMsg = System.Environment.NewLine + "获取所有服务......成功" + System.Environment.NewLine; } if (info.Type == "Start") { PSSMsg = Environment.NewLine + "启动服务......成功,已刷新" + Environment.NewLine; } if (info.Type == "Stop") { PSSMsg = Environment.NewLine + "停止服务......成功,已刷新" + Environment.NewLine; } if (info.Type == "Restart") { PSSMsg = Environment.NewLine + "重启服务......成功,已刷新" + Environment.NewLine; } if (info.Type == "Pause") { PSSMsg = Environment.NewLine + "暂停服务......成功,已刷新" + Environment.NewLine; } if (info.Type == "Status_Auto") { PSSMsg = Environment.NewLine + "修改服务状态为自动......成功,已刷新" + Environment.NewLine; } if (info.Type == "Status_Demand") { PSSMsg = Environment.NewLine + "修改服务状态为手动......成功,已刷新" + Environment.NewLine; } if (info.Type == "Status_Disabled") { PSSMsg = Environment.NewLine + "修改服务状态为禁用......成功,已刷新" + Environment.NewLine; } Service_lV.Invoke(new ListViewPushEvent(AddServiceInfo)); PSS_rTB.Invoke(new RichTextBoxAddEvent(PSSMsgInfo)); }
/// <summary> /// 发送服务查询结果 /// </summary> /// <param name="sender"></param> /// <param name="code"></param> private void sendServicesInfoRsult(BaseCommunication sender, ThreeCode code) { try { PublicCodes info = new PublicCodes(); info.Head = CodeHead.SEND_SERVERINFO; if (code.Body == "Freshen") { info.Msg = BD.GetService(); info.Type = code.Body; } ; if (code.Body == "Start") { BD.StartService(code.Foot); info.Msg = BD.GetService(); info.Type = code.Body; } ; if (code.Body == "Stop") { BD.StopService(code.Foot); info.Msg = BD.GetService(); info.Type = code.Body; } ; if (code.Body == "Status_Auto") { BD.ChangeStateService(code.Foot, 2); info.Msg = BD.GetService(); info.Type = code.Body; } ; if (code.Body == "Status_Demand") { BD.ChangeStateService(code.Foot, 3); info.Msg = BD.GetService(); info.Type = code.Body; } ; if (code.Body == "Status_Disabled") { BD.ChangeStateService(code.Foot, 4); info.Msg = BD.GetService(); info.Type = code.Body; } ; sender.SendCode(info); } catch { } }