G
Guest
Hi
Can someone please tell me how I can browse a FTP directory location in C#
and then download.
I am using something like:
DirectoryInfo DirInfo = new
DirectoryInfo("ftp://ftp.mysite.org/myftp/MYINBOUNDTEST");
FileInfo[] Files = DirInfo.GetFiles("*.asc");
This obviously is not correct as this will work for a local file path like
"c:\mysample".
Also, the code below won't work for me as it requires the filename in the
ServerUri.
WebClient request = new WebClient();
request.Credentials = new NetworkCredential("myftp", "mypwd");
request.DownloadFile(serverUri, "sample.txt.asc");
Just as an FYI, the FTP site also requires a login/pwd. If any idea pls.
reply asap.
Can someone please tell me how I can browse a FTP directory location in C#
and then download.
I am using something like:
DirectoryInfo DirInfo = new
DirectoryInfo("ftp://ftp.mysite.org/myftp/MYINBOUNDTEST");
FileInfo[] Files = DirInfo.GetFiles("*.asc");
This obviously is not correct as this will work for a local file path like
"c:\mysample".
Also, the code below won't work for me as it requires the filename in the
ServerUri.
WebClient request = new WebClient();
request.Credentials = new NetworkCredential("myftp", "mypwd");
request.DownloadFile(serverUri, "sample.txt.asc");
Just as an FYI, the FTP site also requires a login/pwd. If any idea pls.
reply asap.