Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 6th, 2004, 12:57 AM
Authorized User
 
Join Date: Aug 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Transfer Files via FTP

I want to transfer a file through FTP to another computer,I have no idea of it,of course I have tested the methods of Uri and UriBuiding ad uploading to the destination,but it did not solved my problem.DOes anybody why my proccess does not wok in a project of ASP.NET with the codebehind:
String FileName="E:\\Documents and Settings\\snutmp43\\Desktop\\MyXml.xml";
            UriBuilder URI=new UriBuilder();
            URI.Scheme="ftp";
            URI.Host="localhost";
            URI.Port=21;
            URI.Path="Virtual/Xml.xml";
            Uri MuUri=URI.Uri;
            Response.Write(MuUri.ToString());
            WebClient client=new WebClient();
            client.UploadFile(MuUri.ToString(),FileName);
I need some guidance,or even better a simple sample,of tranfering files via FTP through an ASP.NET web application by the code behind C#.Please help me as soon as U can:(

 
Old September 7th, 2004, 09:36 PM
Authorized User
 
Join Date: Jul 2004
Posts: 69
Thanks: 0
Thanked 1 Time in 1 Post
Default

Well, there isn't an easy answer for you unfortunately. You have to write a class that acts as an FTP client. I have one that works well, but my boss says we can't give it away, sorry. You may want to refer to this link:

http://www.csharphelp.com/archives/archive9.html

Hope this helps,

www.CoderForRent.com
Get A Computer Job!
 
Old September 8th, 2004, 12:36 AM
Authorized User
 
Join Date: Aug 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks,that worked!

But I found some bugs,the getlist in the project only acts correctly for the first time that I define a mask,it does not rok properly when I call the function with a repeated mask,
and It can not change the path(the Virtual Directories) except one time at first,do you have any idea?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Secured FTP File Transfer syed_sooraj Classic ASP Basics 1 December 7th, 2007 06:29 PM
problem picking up files after ftp transfer holdmykidney Pro Java 0 September 11th, 2006 06:17 AM
DTS FTP Task file disappears after transfer tdawg69311 SQL Server DTS 0 April 28th, 2006 03:38 PM
Transfer files via FTP by using ASP.NET vb_developer Classic ASP Basics 1 September 6th, 2004 03:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.