C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Fill a DropDownList with files in a directory using c#


Posted Date: 25 Apr 2008    Resource Type: Code Snippets    Category: Databinding

Posted By: Suresh       Member Level: Bronze
Rating:     Points: 7



The code shows how to fill a dropdownlist control with files in a directory, using c#.

The string 'dirpath' stores the directory path, which can be changed to any custom path.


private void fill_ddl()
{
string dirpath="D:\\Temp\\New";
DirectoryInfo dir = new DirectoryInfo(dirpath);
foreach(FileInfo files in dir.GetFiles())
{
DropDownList1.Items.Add(files.Name);
}

}





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: adding data from dataset to listview...
Previous Resource: Bind DropDownList from DataBase , Using c#
Return to Discussion Resource Index
Post New Resource
Category: Databinding


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

conference calls

Contact Us    Privacy Policy    Terms Of Use