processInfo.Arguments = arguments; #endregion //Create new Process Process process = new Process(); try ...{ //Start execute the ProcessStartInfo process.StartInfo = processInfo; //Run the process process.Start(); //Input "y" for the psftp's first login prompt //Just for the security information process.StandardInput.WriteLine("y"); //Get the return message from process(Error and Output information) //This message will be logged to file for debug! outPutMessage += process.StandardOutput.ReadToEnd(); outPutMessage += process.StandardError.ReadToEnd(); //Wait for the process exit process.WaitForExit(); //Close all the modules opened process.Close(); process.Dispose(); //Delete the script file File.Delete(scriptLocation); return outPutMessage; }
上一页 [1] [2] [3] [4] [5] 下一页