i’m having an issue with my code, i’m trying to add items from directory to listbox, the issue is i keep getting the same items (doplucate) over and over again
here is my code
String[] filesDir = Directory.GetFiles(@"C:FOLDER");
foreach (string file in filesDir)
if (!this.listbox1.Items.Contains(file ))
{
listbox1.Items.Add(Path.GetFileNameWithoutExtension(file ) + @" found");
}
1