استاد من این متد رو اینجوری تغییر دادم نظرتون چیه :?: :idea:
private void button1_Click(object sender, System.EventArgs e)
{
System.Threading.Thread Se = new System.Threading.Thread(
new System.Threading.ThreadStart(this.Search)& #41;;
n.Start();
}
private void Search()
{
this.listBox1.Items.Clear();
int num = 0;
System.Collections.ArrayList arr = new System.Collections.ArrayList();
arr.Add("d:\\");
string drives = "";
foreach(string d in System.IO.Directory.GetLogicalDrives()) ;
{
drives += d + "\n";
}
MessageBox.Show(drives);
if(arr.Count != 0)
{
for(int i = 0; i != arr.Count;i++)
{
foreach(string n in System.IO.Directory.GetDirectories(arr[num ].ToString()))
{
arr.Add(n);
}
foreach(string f in System.IO.Directory.GetFiles(arr[num]. ToString(),"*.*"))
{
listBox1.Items.Add(f);
this.label1.Text = f.ToString();
Application.DoEvents();
}
num++;
}
}
MessageBox.Show(this.listBox1.Items.Count.ToSt ring());
}