private void button1_Click(object sender, RoutedEventArgs e)
{
if (Directory.Exists("C:\\sm") == true)
{
string[] files = Directory.GetFiles("C:\\sm");
if (files.Length == 0)
{
MessageBox.Show("There is no files to collect!");
}
else
{
foreach (string f in files)
{
listBox1.Items.Add(System.IO.Path.GetFileName(f).ToString());
}
}
}
}