The following code with the search pattern of "*.dll" will add to a list box all files found with a "dll" extension. string d = "C:\\"; foreach (string f in Directory.GetFiles(d, "*.dll")) { ...