public override PipeOutput Run(PipeInput input) { using (var conn = GetConnection()) { var inputModel = _insertDouData.CreateInput(input.FromBase64()); if (inputModel != null) { conn.Execute(inputModel.Command, inputModel.Parameters); } else { return(PipeOutput.FromString($"ErroCount = {(_errorCount++).ToString()}")); } } return(PipeOutput.FromString((_lineNumber++).ToString())); }
public override PipeOutput Run(PipeInput input) { string args = input; var procStartInfo = new ProcessStartInfo { FileName = _process, Arguments = String.Format(_arguments, args), UseShellExecute = false, WindowStyle = ProcessWindowStyle.Normal, RedirectStandardOutput = true }; var process = Process.Start(procStartInfo); var reader = process.StandardOutput; string result = reader.ReadToEnd().Trim('\n'); return(PipeOutput.FromString(result)); }