Geeks With Blogs
Fórmulas e Cenas Object Reference Not Set to an Instance of an Object

FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://myFTPURL/"));
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential("myUser", "myPassword", "FTPDomain");

reqFTP.Method = WebRequestMethods.Ftp.ListDirectory;

WebResponse response = reqFTP.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());

string line = reader.ReadLine();
while (line != null)
{
    line = reader.ReadLine();
}

reader.Close();
response.Close();

 

Enjoy :)

Posted on Thursday, October 7, 2010 11:17 AM Geral , C# | Back to top


Comments on this post: How to: List Files from an FTP Location

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Sglima | Powered by: GeeksWithBlogs.net