Solved

SFTP C# Mono

Posted on 2010-09-15
7
1,863 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!

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.

 
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

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

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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