• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# System.ProcessResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.ProcessResult的典型用法代码示例。如果您正苦于以下问题:C# ProcessResult类的具体用法?C# ProcessResult怎么用?C# ProcessResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProcessResult类属于System命名空间,在下文中一共展示了ProcessResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Process

        public override ProcessResult Process()
        {
            ProcessResult res = new ProcessResult();

            try
            {
                Process p = System.Diagnostics.Process.GetProcessById(processID);
                if (p != null)
                {
                    p.Kill();
                    res.ErrorCode = 0;
                    return res;
                }
                else
                {
                    res.ErrorCode = 6;
                    res.ErrorDetails = "Nie ma takiego procesu";
                    return res;
                }
            }
            catch (Exception exc)
            {
                res.ErrorCode = 5;
                res.ErrorDetails = exc.ToString();
            }
            return res;
        }
开发者ID:macper,项目名称:MWRWebRemoter,代码行数:27,代码来源:KillProcessTask.cs


示例2: BuscarSolicitudVenta

        public ProcessResult<List<SolicitudVentaDomain>> BuscarSolicitudVenta(int numerosolicitud)
        {
            ProcessResult<List<SolicitudVentaDomain>> list = new ProcessResult<List<SolicitudVentaDomain>>();
            List<SolicitudVentaDomain> listResult = new List<SolicitudVentaDomain>();
            try
            {
                List<SolicitudVentaLogic> solicitudVenta = EmpleadoLogicRepository.BuscarSolicitudVenta(numerosolicitud);

                foreach (var item in solicitudVenta)
                {
                    SolicitudVentaDomain svd = new SolicitudVentaDomain();

                    svd.productoId = item.productoId;
                    svd.descripcionProducto = item.descripcionProducto;
                    svd.presentacionProducto = item.presentacionProducto;
                    svd.cantidadProducto = item.cantidadProducto;
                    svd.descuento = item.descuento;
                    svd.precioProducto = item.precioProducto;
                    svd.subtotal = item.subtotal;

                    listResult.Add(svd);
                }

                list.Result = listResult;

            }
            catch (Exception e)
            {
                list.IsSuccess = true;
                list.Exception = new ApplicationLayerException<SolicitudPermisoService>("Ocurrio un problema en el sistema", e);
            }
            return list;
        }
开发者ID:OmarCruz,项目名称:Pe.ByS.ERP,代码行数:33,代码来源:SolicitudPermisoService.cs


示例3: VerifyProcessRan

 static void VerifyProcessRan(this Process command, ProcessResult result)
 {
     if (!result.Success)
         throw new ProcessRunnerException(
             string.Format("Failed to execute process \"{0}\". Process status was {1}.",
                 command.Options.CommandLine, result.Status));
 }
开发者ID:tomaskovarik,项目名称:chalk,代码行数:7,代码来源:ProcessExtensions.cs


示例4: Process

        public override ProcessResult Process(string ip, InstructionTask instructionTask)
        {
            ProcessResult result = new ProcessResult();

            result.Done = false;
            result.Message = "设置检测仪IP地址失败!";

            return result;
        }
开发者ID:egretor,项目名称:EnvironmentalMonitor,代码行数:9,代码来源:IpErrorInstruction.cs


示例5: Process

        public override ProcessResult Process(string ip, InstructionTask instructionTask)
        {
            ProcessResult result = new ProcessResult();

            result.Done = true;
            result.Message = "设置检测仪探头阀值下限成功!";

            return result;
        }
开发者ID:egretor,项目名称:EnvironmentalMonitor,代码行数:9,代码来源:MinimumThresholdSuccessInstruction.cs


示例6: Process

        public override ProcessResult Process(string ip, InstructionTask instructionTask)
        {
            ProcessResult result = new ProcessResult();

            result.Done = false;
            result.Message = string.Empty;

            return result;
        }
开发者ID:egretor,项目名称:EnvironmentalMonitor,代码行数:9,代码来源:MessageErrorInstruction.cs


示例7: Process

        override public ProcessResult Process(ProcessResult lastSiblingResult, TriggerObject trigObject)
        {
            trigObject.CurrentNodeExecutionChain.Add(this);

            ProcessResult result = UserDefinedFunction.Execute(trigObject);

            trigObject.CurrentNodeExecutionChain.Remove(this);
            return result;
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:9,代码来源:UserDefinedFunctionExecuteNode.cs


示例8: LogProcessResult

 /// <summary>
 /// Logs the result of a finished process.
 /// </summary>
 public static void LogProcessResult(ProcessResult result)
 {
     var outcome = result.Failed ? "failed" : "succeeded";
     Console.WriteLine($"The process \"{result.ExecutablePath} {result.Args}\" {outcome} with code {result.Code}.");
     Console.WriteLine($"Standard Out:");
     Console.WriteLine(result.StdOut);
     Console.WriteLine($"Standard Error:");
     Console.WriteLine(result.StdErr);
 }
开发者ID:xamarin,项目名称:benchmarker,代码行数:12,代码来源:TestUtilities.cs


示例9: Process

        public override ProcessResult Process(ProcessResult lastSiblingResult, TriggerObject trigObject)
        {
            if (InfiniteLoopRisk == true)
                throw new UberScriptException("Line " + LineNumber + ": " + base.ScriptString + "\nAttempted to execute ForLoop with InfiniteLoop risk!  Skipping for loop!");

            int maxLoopNumber = 10000;
            int loopCount = 0;

            // first try to execute the initial statement
            if (InitialStatement != null)
            {
                InitialStatement.Process(ProcessResult.None, trigObject);
            }

            Object result = ConditionalMathTree.Calculate(trigObject);
            while (result is bool && (bool)result)
            {
                //execute the child code
                ProcessResult lastResult = ProcessChildren(trigObject);
                if (lastResult == ProcessResult.Break) // exit out of this for loop
                    return ProcessResult.None;
                if (lastResult == ProcessResult.Return || lastResult == ProcessResult.ReturnOverride)
                {
                    return lastResult;
                }
                // ProcessResult.Continue--just keep going

                //execute the next part of the loop (often ints.i++)
                try
                {
                    RepeatedStatement.Process(ProcessResult.None, trigObject);
                }
                catch (Exception e)
                {
                    throw new UberScriptException("Line " + LineNumber + ": " + base.ScriptString + "\nForLoop Repeated Statement execution error: ", e);
                }
                try
                {
                    // see whether we still meet our condition
                    result = ConditionalMathTree.Calculate(trigObject);
                }
                catch (Exception e)
                {
                    throw new UberScriptException("Line " + LineNumber + ": " + base.ScriptString + "\nForLoop Conditional Statement execution error: ", e);
                }
                
                loopCount++;
                if (loopCount > maxLoopNumber)
                {
                    InfiniteLoopRisk = true;
                    throw new UberScriptException("Attempted to execute ForLoop with InfiniteLoop risk!  Skipping for loop!");
                }
            }

            return ProcessResult.None;
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:56,代码来源:ForLoopNode.cs


示例10: SetUp

 public void SetUp()
 {
     _mocks = new MockRepository(MockBehavior.Strict);
     _viewFactoryMock = _mocks.Create<IViewFactory>();
     _viewMock = _mocks.Create<IView<ProcessResult>>();
     _renderedResult = null;
     _viewMock.Setup(it => it.Render(It.IsNotNull<ProcessResult>()))
         .Callback<ProcessResult>(
             result => { _renderedResult = result; }
         );
     _viewFactoryMock.Setup(it => it.CreateView<ProcessResult>("text")).Returns(_viewMock.Object);
 }
开发者ID:rgavrilov,项目名称:Sogeti,代码行数:12,代码来源:ControllerTest.cs


示例11: BeginProcessRequest

        public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
        {
            var apm = new ProcessResult(cb, context, extraData);

            context.Response.Write(string.Format("<h1>This handler uses a simple custom implementation of the IAsyncResult interface (Async Programming Model)</h1><br/><br/><hr/><br/><br/>"));

            context.Response.Write(string.Format("<br/>Before calling start asynchronously: {0} ThreadPool ID: {1}", DateTime.Now.ToString(), Thread.CurrentThread.ManagedThreadId));
            apm.Start();
            context.Response.Write(string.Format("<br/>After calling start asynchronously: {0} ThreadPool ID: {1}", DateTime.Now.ToString(), Thread.CurrentThread.ManagedThreadId));

            return apm;
        }
开发者ID:gabla5,项目名称:LearningProjects,代码行数:12,代码来源:RetrievingImageAsyncHandler.cs


示例12: BeginProcessRequest

        public IAsyncResult BeginProcessRequest(object sender, EventArgs e, AsyncCallback cb, object extraData)
        {
            HttpContext.Current.Response.Write(string.Format("<br /> Thread ID: {0} From: {1}", Thread.CurrentThread.ManagedThreadId, MethodInfo.GetCurrentMethod().Name));
            //Func<TimeSpan, DateTime> operation = this.ExecuteLongTimeConsumingOperation;

            //return operation.BeginInvoke(TimeSpan.FromDays(10), cb, extraData);

            var f = new ProcessResult(cb, this.Context, extraData);

            f.Start();

            return f;
        }
开发者ID:gabla5,项目名称:LearningProjects,代码行数:13,代码来源:AsyncPage.aspx.cs


示例13: ToString

 public static string ToString(ProcessResult result)
 {
     switch (result) {
         case ProcessResult.EmptyImage:
             return @"Ошибочное изображение";
         case ProcessResult.NotDetected:
             return @"Не определено лицо";
         case ProcessResult.Success:
             return @"Удачно";
         default:
             return @"Ошибка обработки";
     }
 }
开发者ID:Pastor,项目名称:videotools,代码行数:13,代码来源:Native.cs


示例14: VerifyExitCode

        static void VerifyExitCode(this Process command, ProcessResult result, ResultExpectation resultExpectation, ILogger logger)
        {
            if (result.ExitCode == SuccessExitCode)
                return;

            string message = string.Format("Process \"{0}\" failed, exit code {1}. All output: {2}",
                command.Options.CommandLine, result.ExitCode, result.AllOutput);

            if (resultExpectation == ResultExpectation.MustNotFail)
                throw new Exception(message);

            logger.LogWarning(message);
        }
开发者ID:tomaskovarik,项目名称:chalk,代码行数:13,代码来源:ProcessExtensions.cs


示例15: Process

 public override ProcessResult Process()
 {
     ProcessResult result = new ProcessResult();
     try
     {
         activeProcesses = System.Diagnostics.Process.GetProcesses();
     }
     catch (Exception exc)
     {
         result.ErrorCode = 5;
         result.ErrorDetails = exc.ToString();
     }
     return result;
 }
开发者ID:macper,项目名称:MWRWebRemoter,代码行数:14,代码来源:RefreshProcessListState.cs


示例16: Process

 public override ProcessResult Process()
 {
     ProcessResult res = new ProcessResult();
     try
     {
         System.Diagnostics.Process.Start(FilePath);
         res.ErrorCode = 0;
     }
     catch (Exception exc)
     {
         res.ErrorCode = 5;
         res.ErrorDetails = exc.ToString();
     }
     return res;
 }
开发者ID:macper,项目名称:MWRWebRemoter,代码行数:15,代码来源:StartProcessTask.cs


示例17: PrintResult

 internal static void PrintResult(ProcessResult status)
 {
     string result = status.ToString();
     ConsoleColor? color = null;
     switch (status)
     {
         case ProcessResult.Skipped:
             break;
         case ProcessResult.Success:
             color = ConsoleColor.Green;
             break;
         case ProcessResult.Fail:
             color = ConsoleColor.Red;
             break;
         default:
             color = ConsoleColor.Yellow;
             break;
     }
     PrintResult(result, 60, color);
 }
开发者ID:13xforever,项目名称:DeDRM,代码行数:20,代码来源:Logger.cs


示例18: BuscarEmpleadoPorId

        public ProcessResult<EmpleadoDomain> BuscarEmpleadoPorId(int Id)
        {
            ProcessResult<EmpleadoDomain> result = new ProcessResult<EmpleadoDomain>();
            try
            {
                Id = 1;
                EmpleadoLogic empleado = EmpleadoLogicRepository.FindById(Id);

                /*EmpleadoDomain empleado = new EmpleadoDomain();
                empleado.Id = 1;
                empleado.Nombre = "Cesar Kina";
                empleado.TipoEmpleado = 2;

                result.Result = empleado;*/
            }
            catch (Exception e)
            {
                result.IsSuccess = true;
                result.Exception = new ApplicationLayerException<SolicitudPermisoService>("Ocurrio un problema en el sistema", e);
            }

            return result;
        }
开发者ID:OmarCruz,项目名称:Pe.ByS.ERP,代码行数:23,代码来源:SolicitudPermisoService.cs


示例19: Process

        public override ProcessResult Process()
        {
            ProcessResult res = new ProcessResult();
            res.ErrorCode = 0;
            Bitmap bmp = null;
            Graphics graph = null;
            FtpClient ftpClient = null;
            try
            {
                bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
                graph = Graphics.FromImage(bmp);
                graph.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
                FileName = string.Format("zrzut_{0}-{1}-{2}_{3}.jpg", DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), DateTime.Now.Day.ToString(), DateTime.Now.Ticks.ToString());
                bmp.Save(FileName, ImageFormat.Jpeg);
                     ftpClient = new FtpClient(FTPSettings.ServerAddress, FTPSettings.User, FTPSettings.Password);
                     ftpClient.ChangeDir(FTPSettings.Directory);
                ftpClient.Upload(FileName);
                System.IO.File.Delete(FileName);

            }
            catch (Exception exc)
            {
                res.ErrorCode = 5;
                res.ErrorDetails = exc.ToString();
            }
            finally
            {
                if (ftpClient != null)
                ftpClient.Close();
                if (graph != null)
                graph.Dispose();
                if (bmp != null)
                bmp.Dispose();
            }
            return res;
        }
开发者ID:macper,项目名称:MWRWebRemoter,代码行数:36,代码来源:MakeScreenshootTask.cs


示例20: Process

        public override ProcessResult Process(ProcessResult lastSiblingResult, TriggerObject trigObject)
        {
            ProcessResult lastResult = ProcessResult.None;
            // NOTE: I commented out the try here because
            if (trigObject.PausedNodeChain != null)
            {
                if (trigObject.PausedNodeChain.Count == 1 && trigObject.PausedNodeChain.Peek() == this)
                {
                    trigObject.PausedNodeChain = null;
                }
                else
                {
                    // it was paused inside of the spawnentry statement, so just keep going
                    return ProcessChildren(trigObject);
                }
            }

            lastResult = ProcessChildren(trigObject);
            if (lastResult == ProcessResult.Return || lastResult == ProcessResult.ReturnOverride || lastResult == ProcessResult.Break || lastResult == ProcessResult.Continue)
            {
                return lastResult;
            }
            return ProcessResult.None;
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:24,代码来源:SpawnEntryNode.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# System.Program类代码示例发布时间:2022-05-26
下一篇:
C# System.Point类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap