Solved

SFTP C# Mono

Posted on 2010-09-15
7
1,848 Views
Last Modified: 2016-02-19
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?
0
Comment
Question by:Aanvik
  • 4
  • 3
7 Comments
 
LVL 12

Expert Comment

by:Mortaza Doulaty
ID: 33689615
Do you want to do it using sftp command, or you would like to do it in a different way?
0
 
LVL 12

Expert Comment

by:Mortaza Doulaty
ID: 33689635
0
 
LVL 5

Author Comment

by:Aanvik
ID: 33691099
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 ?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 12

Expert Comment

by:Mortaza Doulaty
ID: 33693766
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.
0
 
LVL 5

Author Comment

by:Aanvik
ID: 33693888
Ok.. Thank you.

I know System.Diagnostic.Process class
System.Diagnostic.Process.Start(What)
0
 
LVL 12

Accepted Solution

by:
Mortaza Doulaty earned 500 total points
ID: 33702944
You just need to instantiate a variable of  System.Diagnostic.Process class.
Then you need to adjust the values of SartInfo.
Have a look at http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx
0
 
LVL 5

Author Closing Comment

by:Aanvik
ID: 33855060
It helped.. thank you.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question