private void addMusic_Click(object sender, RoutedEventArgs e)
{
System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
System.Windows.Forms.DialogResult result = dialog.ShowDialog();
if (dialog.SelectedPath != "")
{
DirectoryInfo direcInfo = new DirectoryInfo(dialog.SelectedPath);
FileInfo[] files = direcInfo.GetFiles("*.mp3");
foreach (FileInfo fileInfo in files)
{
listbox2.Items.Add(new Dosya(System.IO.Path.GetFileNameWithoutExtension(fileInfo.Name), fileInfo.FullName));
if (listbox2.Items.Contains(files) == true) //Karşılaştırmaya çalıştığım yer
{
listbox2.Items.Clear(); // Eğer karşılaştırdaysa aynı olan varsa listeyi temizleyecekti. Ancak bana aynı olanları silmesi lazım :)
}
}
}
}