exe를 통해 BCP 명령을 실행 중이며 50000 개의 행을 복사 한 후 멈 춥니 다. 몇 가지 포럼을 살펴본 결과, 최대 출력 제한보다 코드에서 StandardOuputReader를 사용하면 50000 행에 가까운 것이 나에게 있다는 것을 알게되었습니다. 50000 개가 넘는 행을 리디렉션 출력에서 실행할 수있는 방법이 있습니까 나가. 표준 출력 리더기 BCP 도구를 멈춤
이 코드
내가proc.StartInfo.RedirectStandardOutput = false;
을 가지고 있지만 내가 출력을 볼 수, 그것은 참으로 갖고 싶어 여기에 작동합니다.
private static void RunBatch(string Fullfilepath, string BatchFilePathDumpFlatFile)
{
mLogger.Error("RunBatch Start=== >");
mLogger.Error("Batch Filepath " + Fullfilepath + '\n' + "Batch File Directory " + BatchFilePathDumpFlatFile);
Process proc = null;
string targetDir = BatchFilePathDumpFlatFile;
proc = new Process();
proc.StartInfo.WorkingDirectory = targetDir;
proc.StartInfo.FileName = Fullfilepath;
//proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.Arguments = "/c";
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.RedirectStandardOutput = false;
proc.Start();
proc.WaitForExit();
string output = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
string error = proc.StandardError.ReadToEnd();
proc.WaitForExit();
mLogger.Error("Output from batch " + output);
mLogger.Error("Error From Batch " + error);
}
업데이트 1이 실수가 내가 사용하고 있습니다
private static void RunBatch(string Fullfilepath, string BatchFilePathDumpFlatFile)
{
mLogger.Error("RunBatch Start=== >");
mLogger.Error("Batch Filepath " + Fullfilepath + '\n' + "Batch File Directory " + BatchFilePathDumpFlatFile);
Process proc = null;
string targetDir = BatchFilePathDumpFlatFile;
proc = new Process();
proc.StartInfo.WorkingDirectory = targetDir;
proc.StartInfo.FileName = Fullfilepath;
//proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.Arguments = "/c";
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
string output = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
string error = proc.StandardError.ReadToEnd();
proc.WaitForExit();
mLogger.Error("Output from batch " + output);
mLogger.Error("Error From Batch " + error);
}
때문에 여전히 BCP이 중지되고 난 코드의 EXE를 중지 할 때 실행을 시작합니다.
나는 그것을 시도했지만 BCP를 계속 복사하고 50000 개의 행을 얻지는 않지만 평범한 파일을 만든 다음 정지합니다. – Ke7in
@ Ke7in 어디에서 멈 춥니 다? 어느 선 이요? 업데이트 된 코드를 게시하십시오. –
헤이 작동, 실제로 그것이 작동하지 않는 것 같아 시간이 걸립니다. – Ke7in