本文整理汇总了C#中System.Diagnostics.ProcessStartInfo.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ProcessStartInfo.ToString方法的具体用法?C# ProcessStartInfo.ToString怎么用?C# ProcessStartInfo.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Diagnostics.ProcessStartInfo
的用法示例。
在下文中一共展示了ProcessStartInfo.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunTests
public void RunTests(SetupData setupData)
{
Starting();
var args = String.Format("-B -u -m unittest discover -v {0} {1}", setupData.TestSubFolder, setupData.TestFileSpec);
var startInfo = new ProcessStartInfo
{
UseShellExecute = false,
RedirectStandardError = true,
CreateNoWindow = true,
FileName = setupData.PythonPath,
Arguments = args,
WorkingDirectory = setupData.ProjectFolder
};
Debug.WriteLine(startInfo.ToString());
using (var python = new Process { StartInfo = startInfo })
{
python.Start();
_testResultParser.Parse(python.StandardError, TestResultReady, TestResultDetailsReady);
}
Finished();
}
示例2: StartZAPDaemon
public static void StartZAPDaemon()
{
Console.WriteLine("Trying to StartZAPDaemon");
ProcessStartInfo zapProcessStartInfo = new ProcessStartInfo();
zapProcessStartInfo.FileName = @"C:\Program Files (x86)\OWASP\Zed Attack Proxy\ZAP.exe";
zapProcessStartInfo.WorkingDirectory = @"C:\Program Files (x86)\OWASP\Zed Attack Proxy";
zapProcessStartInfo.Arguments = "-daemon -host 127.0.0.1 -port 7070";
Console.WriteLine("Issuing command to StartZAPDaemon");
Console.WriteLine(zapProcessStartInfo.ToString());
Process zap = Process.Start(zapProcessStartInfo);
//Sleep(120000); //you can choose to wait for 2 minutes and bet that ZAP has started
CheckIfZAPHasStartedByPollingTheAPI(1); //you can try accessing an API and ensure ZAP has fully initialized
}
示例3: AddRoute
// Since the Windows XP does not support the multiple default gateway.
// In order to make the Ethernet can be access via its default gateway, we need to add the gateway into the route table.
// For more information, plesae refer to the KB article.
// http://support.microsoft.com/kb/159168
private static void AddRoute(string gateway, string destination)
{
ProcessStartInfo startInfo = new ProcessStartInfo("route");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = string.Format(" add {0} mask 255.255.255.255 {1}", destination, gateway);
startInfo.Verb = "runas";
string commandline = startInfo.ToString();
MessageBox.Show("Executing: route " + startInfo.Arguments);
Process p = Process.Start(startInfo);
p.WaitForExit();
int exitCode = p.ExitCode;
if (exitCode != 0)
{
MessageBox.Show("hmm .. exitCode " + exitCode+ " (whatever that means)");
}
}