I can download all the directories and subdirectories and files..
Now i want to count the no of files that downloaded so far and display it on the form..
So that i can know that how many files has been downloaded n how many have to be downloaded..
i placed a count in downloadFile() as follows
count =count+1;
textBox1.Text=count.ToString();
the counting is taken place.. But after downloading all the files only i could see the no of files downloaded..
i could not see that during downloading..
I need a solution or sample code for it
THANK YOU...
Loading

Kirtan PatelRank #292 · 8.6K reputationPosted Feb 16, 2010, 11:42 PM EST
Here is your Solution !!
using System.IO;
private void button1_Click(object sender, EventArgs e)
{
string NameOfDirectoryToCountFiles = @"D:\Downloads";
string[] Files = Directory.GetFiles(NameOfDirectoryToCountFiles, "*.*", SearchOption.AllDirectories);
MessageBox.Show("Number of Files In Directory Are :" + Files.Length);
}
// if you want to Just Count Files without Sub folder Change SearchOption in GetFiles method :)
Kirtan PatelRank #292 · 8.6K reputationPosted Feb 16, 2010, 11:00 PM EST
please clarify it i can help you :)
ila41 reputationPosted Feb 16, 2010, 11:03 PM EST
Im downloading files from FTP server
Best regards
Ila...