views:

69

answers:

1

I've found that the more I refine a question, the better help I get.

So, to make the question as complete as possible, I'm providing this C# WPF solution created in Visual Studio 2010 Beta 2.

This solution exactly reproduces the problem I'm having, as I try to capture output from ssh.exe using the System.Diagnostics.Process object.

To reproduce this problem, right in front of your own eyes, you'll need two things: (1) An installation of Visual Studio 2010 Beta 2. (2) The IP address of a Linux Server that allows incoming SSH connections.

To modify this code to work, you'll probably need to be just as much a hacker as much as you are a programmer. The code is as complete as I know how to make it. It will monitor the output of almost any other command-line utility (except for ssh.exe).

If you click on my name, you can see all the previous ways I've asked this question. If you have a suggestion, but are unable to download and reproduce this problem, please submit you answers to one of those previous question instead:

I'd like to reserve this question to those who have the prerequisites to reproduce the problem, and answer it by showing how they made it work (with certain modifications).

+1  A: 

I have read your question and I have not reproduced or fixed this issue. I however do offer some good (I hope ) advice. You have been trying to make this approach work and not succeeding, I would suggest trying a different approach.

I would look into the existing C# SSH libraries (1 2 3) which have been coded, tested, proved and will provide a much nicer interface than System.Diagnostics.Process.

I know this does not answer your question, but it could resolve your issue.

David Waters
David, your suggestion may be the one I'll have to take. However, I wish you would have made a comment instead of an "Answer". Each additional "Answer" posted here, makes my problem look solved, and then my question becomes more unnoticed by people who may be able to make this work (this way).
LonnieBest
I'm looking into each of your suggestions right now.
LonnieBest
@Jeff Yates - Thank you for the spelling clean up.
David Waters
@LonnieBest - I tried to make it clear that I had not addressed the issue in your question. I hope my suggestion was helpful.
David Waters
David, I do appreciate your suggestions. When I establish an ssh connection, using those libraries, I'm not sure how to make the other "client-side command line utilities" (I'm wrapping) utilise that connection. Those utilities expect to be able to (internally) call ssh.exe to establish the encrypted file transfer from client to server.
LonnieBest
@LonnieBest - What other client side scripts are you using? Can these be easily done from within c# directly with the SSH connection there?Sorry I did not relise you had other client scripts that where trying to use this.
David Waters
@LonnoeBest - To enable Client Side scripts to access this connection you will have to act as a middle man, start the client side script, attach to the standardIn and the standardOut, read from the standardOut and write to your SSH Stream, read from your SSH Stream and write to the script standardIn.
David Waters