2011-05-13 9 views
0

임 SHARPSSH SshShell을 .. 난 내 명령을 실행 할 수 있었다, 난 내 유닉스 상자에 연결할 수 있었다 사용SharpSSH은 .. 어떻게 프로세스가 완료되었는지 확인하려면

(결과를 확인하는 데 문제가 있지만) 나는 TAR 명령을 내릴 수 있었다. 나의 문제는 타르가 끝난다면 결정적이다 .. 거기에 SHARPSSH를 사용하여 이것을 검사하는 방법이 있는가 ???

어떤 도움을 주시면 감사하겠습니다 ..

답변

1

당신은 코드를 표시하지 않았기 때문에 문제가 될 수있는 곳은 판단하기 어렵다.

공식 sharpssh 샘플, 특히이 [1]을 살펴 보는 것이 좋습니다. 그것은 당신이 원하는대로 정확하게하는 것 같습니다 : 연결, 결과를 기다리는 명령 을 실행하십시오 /이 명령의 종료.

그래도 도움이되지 않는 경우 자세한 정보를 제공해주십시오.

1 http://sharpssh.svn.sourceforge.net/viewvc/sharpssh/trunk/Examples/sharpssh_samples/SshExeTest.cs?revision=3&view=markup

+0

sshell.WriteLine ("EXP 시스템/my4v4t4r 파일 # = PGNIGDV_budjo.DMP 로그 = PGNIGDV_budjo.log = Y = STATISTICS 전체 NONE"); ----- "EXP"명령이 완료되었는지 어떻게 알 수 있습니까 ?? ---- – Dennis

0
SshExec exec = new SshExec("host","user"); 
      exec.Password = "pass"; 
      //if (input.IdentityFile != null) exec.AddIdentityFile(input.IdentityFile); 

      Console.Write("Connecting..."); 
      exec.Connect(); 
      Console.WriteLine("OK"); 
      while (true) 
      { 
       Console.Write("Enter a command to execute ['Enter' to cancel]: "); 
       string command = "ls"; 
       if (command == "") break; 
       string output = exec.RunCommand(command); 
       Console.WriteLine(output); 
      } 
      Console.Write("Disconnecting..."); 
      exec.Close(); 
      Console.WriteLine("OK"); 

    enter code here 
관련 문제