DirectoryInfo di = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.SendTo)); Foreach(fileinfo fi in di.getfiles()) { ToolstripCombobox1.items.add(fi.name); }
ToolstripCombobox1.items.add(Path.GetFileNameWithoutExtension(fi.name));
private void PopulateToolStripComboBox() { DirectoryInfo di = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.SendTo)); toolStripComboBox1.Items.AddRange(di.GetFiles().Select(file => Path.GetFileNameWithoutExtension(file.Name)).ToArray()); }
string name = fi.Name; name = name.Substring(0, name.Length - fi.Extension.Length);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)