.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Others >> Post New QuestionBookmark and Share Subscribe to Forum

How to copy a file from server to local system

Posted By: Savi3     Posted Date: August 27, 2008    Points:2   Category :Others
Its ver urgent How to copy a file from server system to local system

Responses
Author: Pankaj Mishra             
Posted Date: August 28, 2008     Points: 5   

Hi,

Windows or web Application?

Cheers
Pankaj

Author: Savi3             
Posted Date: August 28, 2008     Points: 5   

Windows Application in C#.net

Author: Pankaj Mishra             
Posted Date: August 28, 2008     Points: 5   

HI,
First Share the folder in the server from which you want to transfer files.then you can use Copy() method of the File object which is in the System.IO namespace. for eg.
try like this using UNC Path


File.Copy(@"\\ServerName\SharedFolderName\YourFile.txt",@"c:\YourFile.txt");


Hope this will help you

Cheers
Pankaj

Author: Meeran             
Posted Date: January 14, 2011     Points: 5   

Please help me out for web application...waiting for your reply

Author: micagordon             
Posted Date: February 03, 2015     Points: 20   

This is trivial to do with a little script. For example:

for server in app0 app1 app4 app5 appN; do
scp user@$server:/path/to/log/file /local/path/to/"$server"_file
done


The above will copy the file from each of the servers sequentially and name it SERVERNAME_file. So, the file from app0 will be app0_file etc. You can obviously change the names to whatever you would like.

I searched the answer on google, I'm not sure whether it will help you on windows application in C# .net.


Best regards.
http://www.onbarcode.com/



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend