System.IO.DirectoryInfo dirInfo = new System.IO.DirectoryInfo("X:\\File\\Path\\");
  System.IO.FileInfo[] files = dirInfo.GetFiles("*.ext");

  yourDropDownList.DataSource = files;
  yourDropDownList.DataBind();

OR we can do it the old fashioned way:

foreach (FileInfo file in files)  {
   yourDropDownList.Items.Add(new ListItem(file.Name));  
}



 


Comments




Leave a Reply

    About the author

    The author have 12+ years experience in IT Industry with varying job roles from system developer/analyst/consultant positions. Majority of her development, implementation and systems support background focus on Financial/Banking/Credit Solutions.

    Archives

    November 2010
    October 2010

    Categories

    All

    RSS Feed