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 PatelPosted Feb 17, 2010, 4:42 AM
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 :)
ilaPosted Feb 17, 2010, 4:03 AM
Im downloading files from FTP server
Best regards
Ila...
Kirtan PatelPosted Feb 17, 2010, 4:00 AM
please clarify it i can help you :)