コード例 #1
0
        private void Log_Click(object sender, EventArgs e)
        {
            string            LogFile    = Environment.CurrentDirectory + "\\Logs\\" + ConfigurationSettings.AppSettings["ErrorLog"];
            StartProcess      LogProcess = new StartProcess();
            ProcessParameters ProcParam  = new ProcessParameters();

            ProcParam.ProcessName        = LogFile;
            LogProcess.ProcessParameters = ProcParam;
            IResult ExecResult = LogProcess.ExecuteCommand();

            if (ExecResult.Result == ExecutionResultType.Failed)
            {
                MessageBox.Show("Failed to open log file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private void StartDeskConnectButton_Click(object sender, EventArgs e)
        {
            string DeskConnectPath = Environment.CurrentDirectory;

            DeskConnectPath = DeskConnectPath + "\\" + ConfigurationSettings.AppSettings["DeskConnectApplication"] + ".exe";
            StartProcess      DeskConnectProcess = new StartProcess();
            ProcessParameters ProcParam          = new ProcessParameters();

            ProcParam.ProcessName = DeskConnectPath;
            DeskConnectProcess.ProcessParameters = ProcParam;
            IResult ExecResult = DeskConnectProcess.ExecuteCommand();

            if (ExecResult.Result == ExecutionResultType.Failed)
            {
                MessageBox.Show("Failed to start Desk Connect", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            RefreshStatus();
        }