private void MoreLabel_Click(object sender, MouseButtonEventArgs e) { int index = this.SettingTab.SelectedIndex; string pdf = ""; switch (index) { case 0: pdf = ConfigResource.GetRDP_PDF_PATH(); break; case 1: pdf = ConfigResource.GetGAME_PDF_PATH(); break; //case 2: // pdf = ConfigResource.GetSCREEN_PDF_PATH(); // break; case 2: pdf = ConfigResource.GetLONGCENNECT_PDF_PATH(); break; case 3: pdf = ConfigResource.GetNAS_PDF_PATH(); break; case 4: pdf = ConfigResource.GetSOFTWAREUSE_PDF_PATH(); break; } Process rdcProcess = new Process(); rdcProcess.StartInfo.FileName = "cmd.exe"; rdcProcess.StartInfo.UseShellExecute = false; rdcProcess.StartInfo.RedirectStandardInput = true; //接受来自调用程序的输入信息 rdcProcess.StartInfo.RedirectStandardOutput = true; //由调用程序获取输出信息 rdcProcess.StartInfo.RedirectStandardError = true; //重定向标准错误输出 rdcProcess.StartInfo.CreateNoWindow = true; //不显示程序窗口 //rdcProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized; rdcProcess.Start(); rdcProcess.StandardInput.WriteLine("\"" + pdf + "\"" + "&exit"); rdcProcess.StandardInput.AutoFlush = true; rdcProcess.Close(); }
private void Label_More_Click(object sender, MouseButtonEventArgs e) { string pdf = ""; switch (current) { case REMOTEDESKTOP: pdf = ConfigResource.GetRDP_PDF_PATH(); break; case GAME: pdf = ConfigResource.GetGAME_PDF_PATH(); break; case LONGIN: pdf = ConfigResource.GetLONGCENNECT_PDF_PATH(); break; case NAS: pdf = ConfigResource.GetNAS_PDF_PATH(); break; case SCREEN: pdf = ConfigResource.GetSCREEN_PDF_PATH(); //this.Close(); break; } Process rdcProcess = new Process(); rdcProcess.StartInfo.FileName = "cmd.exe"; rdcProcess.StartInfo.UseShellExecute = false; rdcProcess.StartInfo.RedirectStandardInput = true; //接受来自调用程序的输入信息 rdcProcess.StartInfo.RedirectStandardOutput = true; //由调用程序获取输出信息 rdcProcess.StartInfo.RedirectStandardError = true; //重定向标准错误输出 rdcProcess.StartInfo.CreateNoWindow = true; //不显示程序窗口 //rdcProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized; rdcProcess.Start(); rdcProcess.StandardInput.WriteLine("\"" + pdf + "\"" + "&exit"); rdcProcess.StandardInput.AutoFlush = true; rdcProcess.Close(); }