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


C# ProcessExecutor.Execute方法代码示例

本文整理汇总了C#中ThoughtWorks.CruiseControl.Core.Util.ProcessExecutor.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# ProcessExecutor.Execute方法的具体用法?C# ProcessExecutor.Execute怎么用?C# ProcessExecutor.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ThoughtWorks.CruiseControl.Core.Util.ProcessExecutor的用法示例。


在下文中一共展示了ProcessExecutor.Execute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RunSvnProcess

        public static ProcessResult RunSvnProcess(SvnOptions svnLoginOptions, ProcessArgumentBuilder argBuilder)
        {
            argBuilder.AddArgument("--non-interactive");
            argBuilder.AddArgument("--no-auth-cache");

            ProcessInfo info = new ProcessInfo("svn.exe", argBuilder.ToString());

            ProcessExecutor executor = new ProcessExecutor();
            ProcessResult result = executor.Execute(info);
            return result;
        }
开发者ID:nfrey,项目名称:qreal,代码行数:11,代码来源:SvnProcessHelper.cs

示例2: DeleteDirectoryWithLongPath

        /// <summary>
        /// Deletes a directory on Windows with a commandline call.
        /// 
        /// Reason:
        /// .NET only supports filenames up to 260 characters long for backwards compability
        /// read more at: http://blogs.msdn.com/bclteam/archive/2007/02/13/long-paths-in-net-part-1-of-3-kim-hamilton.aspx
        /// this is a Windows only limitation
        /// </summary>
        /// <param name="path">Path to delete.</param>
        static void DeleteDirectoryWithLongPath(string path)
        {
            Log.Info("[IoService] Try running 'cmd.exe /C RD /S /Q' to delete '{0}'", path);

            // call a commandline delete as fallback
            var executor = new ProcessExecutor();
            var processInfo = new ProcessInfo("cmd.exe",
                string.Concat("/C RD /S /Q ", StringUtil.AutoDoubleQuoteString(path)));

            var pr = executor.Execute(processInfo);
            if (pr.Failed)
                throw new CruiseControlException(string.Format("Unable to delete path '{0}'.", path));
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:22,代码来源:IoService.cs

示例3: ExecutorShouldTimeOut

				private void ExecutorShouldTimeOut(ProcessExecutor executor)
				{
					Expect.Call(executor.Execute(null))
							.IgnoreArguments()
							.Return(ProcessResultFixture.CreateTimedOutResult());
				}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:6,代码来源:FakeTaskTest.cs

示例4: RunSvnProcess

        /// <summary>
        /// Runs the Subversion process.
        /// </summary>
        /// <param name="arguments">The command-line arguments.</param>
        /// <returns>The results of executing the process including output.</returns>
        protected virtual ProcessResult RunSvnProcess(ProcessArgumentBuilder arguments)
        {
            // prepare process
            ProcessInfo info = new ProcessInfo(Executable, arguments.ToString());

            // execute process
            ProcessExecutor executor = new ProcessExecutor();
            ProcessResult result = executor.Execute(info);

            // return results
            return result;
        }
开发者ID:neutmute,项目名称:SvnRevisionLabeller,代码行数:17,代码来源:SvnRevisionLabeller.cs

示例5: SetupExecutorMock

 private void SetupExecutorMock(ProcessExecutor executor, string fileName, string args, string workingDir, int timeout)
 {
     Expect.Call(executor.Execute(null))
         .IgnoreArguments()
         .Do(new Function<ProcessInfo, ProcessResult>(info =>
         {
             Assert.AreEqual(fileName, info.FileName);
             Assert.AreEqual(args, info.Arguments);
             Assert.AreEqual(workingDir, info.WorkingDirectory);
             Assert.AreEqual(timeout, info.TimeOut);
             return new ProcessResult(string.Empty, string.Empty, 0, false);
         }));
 }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:13,代码来源:FakeTaskTest.cs


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