code to list the contents of a folder to listbox in c#
Posted Date Unknown Lebin Baby Lebin Baby 4 Comments

code to list the contents of a folder to listbox in c#

See All Responses Below...
Author
Message Rating
Posted on: 10/07/2013
You mean how to add contents to list box ? 

Listbox1.items.add(item) ;

else let me know
Posted on: 10/07/2013
There is something called 
Directory.GetFiles(@"c:vish") .NET API which will list all files and folders 

Try it and let us know..

Tom

Share this page across other social networking sites



Posted on: 10/07/2013
This code will help you.

      string[] filePaths = Directory.GetFiles(txt_browseDirectory.Text);
      foreach (string path in filePaths)
      {
                lstbox_local.DataSource = filePaths;
       }
Posted on: 10/07/2013
to get updated the list just refresh
Share this page across other social networking sites



Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Comments
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site. 

TekTipsDownload
GateExam
Academic Projects
TekTipsExperts



 
Site optimized for IE7, 1280 X 768 and above. Copyright © 2010 - 2018 KTS InfoTech
Site Developed Using KTS WebCloud