Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SFTP C# Mono

Posted on 2010-09-15
7
Medium Priority
?
1,943 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 2000 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

963 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