当前位置: 首页>>代码示例>>C#>>正文


C# ProcessStartInfo.ToString方法代码示例

本文整理汇总了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();
        }
开发者ID:xinmyname,项目名称:pytestmon,代码行数:27,代码来源:TestRunner.cs

示例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
        }
开发者ID:jengra,项目名称:zaproxy,代码行数:15,代码来源:ZAP.cs

示例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)");
     }
 }
开发者ID:ccampo133,项目名称:PlotPing,代码行数:20,代码来源:NetworkInterfaceUtils.cs


注:本文中的System.Diagnostics.ProcessStartInfo.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。