//
// 摘要:
// 启动由包含进程启动信息(例如,要启动的进程的文件名)的参数指定的进程资源,并将该资源与新的 System.Diagnostics.Process
// 组件关联。
//
// 参数:
// startInfo:
// System.Diagnostics.ProcessStartInfo,包含用于启动进程的信息(包括文件名和任何命令行参数)。
//
// 返回结果:
// 与进程资源关联的新的 System.Diagnostics.Process 组件,或者如果没有启动进程资源(例如,如果重用了现有进程),则为 null。
//
// 异常:
// System.InvalidOperationException:
// 在 startInfo 参数的 System.Diagnostics.ProcessStartInfo.FileName 属性中未指定任何文件名。-
// 或 - startInfo 参数的 System.Diagnostics.ProcessStartInfo.UseShellExecute 属性为
// true,而 System.Diagnostics.ProcessStartInfo.RedirectStandardInput、System.Diagnostics.ProcessStartInfo.RedirectStandardOutput
// 或 System.Diagnostics.ProcessStartInfo.RedirectStandardError 属性也为 true。- 或
// -startInfo 参数的 System.Diagnostics.ProcessStartInfo.UseShellExecute 属性为 true,而
// System.Diagnostics.ProcessStartInfo.UserName 属性不为 null 或空,或者 System.Diagnostics.ProcessStartInfo.Password
// 属性不为 null。
//
// System.ArgumentNullException:
// startInfo 参数为 null。
//
// System.ComponentModel.Win32Exception:
// 打开关联的文件时发生了错误。
//
// System.ObjectDisposedException:
// 该进程对象已被释放。
public static Process Start(ProcessStartInfo startInfo);
//
// 摘要:
// 通过指定文档或应用程序文件的名称来启动进程资源,并将资源与新的 System.Diagnostics.Process 组件关联。
//
// 参数:
// fileName:
// 要在进程中运行的文档或应用程序文件的名称。
//
// 返回结果:
// 与进程资源关联的新的 System.Diagnostics.Process 组件,或者如果没有启动进程资源(例如,如果重用了现有进程),则为 null。
//
// 异常:
// System.ComponentModel.Win32Exception:
// 打开关联的文件时发生了错误。
//
// System.ObjectDisposedException:
// 该进程对象已被释放。
//
// System.IO.FileNotFoundException:
// PATH 环境变量有包含引号的字符串。
public static Process Start(string fileName);
//
// 摘要:
// 通过指定应用程序的名称和一组命令行参数来启动一个进程资源,并将该资源与新的 System.Diagnostics.Process 组件相关联。
//
// 参数:
// fileName:
// 要在该进程中运行的应用程序文件的名称。
//
// arguments:
// 启动该进程时传递的命令行参数。
//
// 返回结果:
// 与该进程关联的新的 System.Diagnostics.Process 组件,或者如果没有启动进程资源(例如,如果重用了现有进程),则为 null。
//
// 异常:
// System.InvalidOperationException:
// fileName 或 arguments 参数为 null。
//
// System.ComponentModel.Win32Exception:
// 打开关联的文件时发生了错误。
//
// System.ObjectDisposedException:
// 该进程对象已被释放。
//
// System.IO.FileNotFoundException:
// PATH 环境变量有包含引号的字符串。
public static Process Start(string fileName, string arguments);
//
// 摘要:
// 通过指定应用程序的名称、用户名、密码和域来启动一个进程资源,并将该资源与新的 System.Diagnostics.Process 组件关联起来。
//
// 参数:
// fileName:
// 要在该进程中运行的应用程序文件的名称。
//
// userName:
// 启动进程时使用的用户名。
//
// password:
// 一个 System.Security.SecureString,它包含启动进程时要使用的密码。
//
// domain:
// 启动进程时要使用的域。
//
// 返回结果:
// 与进程资源关联的新的 System.Diagnostics.Process 组件,或者如果没有启动进程资源(例如,如果重用了现有进程),则为 null。
//
// 异常:
// System.InvalidOperationException:
// 未指定文件名。
//
// System.ComponentModel.Win32Exception:
// fileName 不是可执行 (.exe) 文件。
//
// System.ComponentModel.Win32Exception:
// 打开关联的文件时发生了错误。
//
// System.ObjectDisposedException:
// 该进程对象已被释放。
public static Process Start(string fileName, string userName, SecureString password, string domain);
//
// 摘要:
// 通过指定应用程序的名称、一组命令行参数、用户名、密码和域来启动一个进程资源,并将该资源与新的 System.Diagnostics.Process
// 组件关联起来。
//
// 参数:
// fileName:
// 要在该进程中运行的应用程序文件的名称。
//
// arguments:
// 启动该进程时传递的命令行参数。
//
// userName:
// 启动进程时要使用的用户名。
//
// password:
// 一个 System.Security.SecureString,它包含启动进程时要使用的密码。
//
// domain:
// 启动进程时要使用的域。
//
// 返回结果:
// 与进程资源关联的新的 System.Diagnostics.Process 组件,或者如果没有启动进程资源(例如,如果重用了现有进程),则为 null。
//
// 异常:
// System.InvalidOperationException:
// 未指定文件名。
//
// System.ComponentModel.Win32Exception:
// fileName 不是可执行 (.exe) 文件。
//
// System.ComponentModel.Win32Exception:
// 打开关联的文件时发生了错误。
//
// System.ObjectDisposedException:
// 该进程对象已被释放。
public static Process Start(string fileName, string arguments, string userName, SecureString password, string domain);
string argument1 = "\"" + argv1 + "\""; string argument2 = "\"" + argv2 + "\""; Process process = new Process(); process.StartInfo.FileName = System.Environment.CurrentDirectory + "//test.exe"; process.StartInfo.Arguments = argument1 + " " + argument2; process.StartInfo.UseShellExecute = true; ; //启动 process.Start();
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有