Link to home
Start Free TrialLog in
Avatar of Aanvik
Aanvik

asked on

SFTP C# Mono

Hello,
I would like to develop a simple C# code (for a Linux server) using MONO ... to open a sftp connection... put the file and close the connection....
Here's what I am currently doing on Linux manually

sftp fts@trl001
connect to fts@trl001
sftp> Put <some file name>
sftp> bye

I just do these 3 command manually and I was  thinking of writing a C# program on Linux to do this for me...

Any help?
Avatar of Mortaza Doulaty
Mortaza Doulaty
Flag of United Kingdom of Great Britain and Northern Ireland image

Do you want to do it using sftp command, or you would like to do it in a different way?
Avatar of Aanvik
Aanvik

ASKER

In case of using sftp command, you can create a new process and pass the arguments to that process.


Can you pls provide some more details here pls... So in case I use this I won;t have to use these products... correct ?
In case of using sftp command, you won't need those things.

Have a look at System.Diagnostic.Process class.
Also check the sftp command's manual to check how you can pass those parameters to sftp command all in one argument.
Avatar of Aanvik

ASKER

Ok.. Thank you.

I know System.Diagnostic.Process class
System.Diagnostic.Process.Start(What)
ASKER CERTIFIED SOLUTION
Avatar of Mortaza Doulaty
Mortaza Doulaty
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aanvik

ASKER

It helped.. thank you.