473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Need List box to read and display files in C Sharp

Hello.

I need a list box which will display the contents of a folder with a specific files type in it. For instance, if the folder contains .exe, .txt and .zip files I need it to just display the .txt files. How Would I go about doing this?

Thanks, Mark
Mar 24 '12 #1
1 2003
Frinavale
9,735 Expert Mod 8TB
First you need to read the contents of the directory.
Then you can either try binding the ListBox to it, or you can manually loop through the contents and add list items to the list box.

You use the DirectoryInfo class to do this.

-Frinny
Mar 25 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Manu | last post by:
Hi, Here's what i want to accomplish. I want to make a list of frequenctly occuring words in a group of files along with the no of occurances of each The brute force method will be to read the...
4
by: googlinggoogler | last post by:
Hiya, The title says it all really, but im a newbie to python sort of. I can read in files and write files no probs. But what I want to do is read in a couple of files and output them to one...
2
by: Michael A. Covington | last post by:
I want to deploy a project in which the user is provided with a set of READ-ONLY files to use as templates. They will be in a directory to which the user can add files of his own. It's...
10
by: Tibby | last post by:
I need to read/write not only text files, but binary as well. It seems like on binary files, it doesn't right the last 10% of the file. -- Thanks --- Outgoing mail is certified Virus...
2
by: hzgt9b | last post by:
Using VB .NET 2003, I need to delete some read-only files. I tried using System.IO.File.Delete(filename) - but when the files are read-only, I get error messages stating that I don't have proper...
2
by: Kalyan | last post by:
hi all, Here is a small doubt with which iam struggling,The problem is how can i read .doc files and display content in browser in php.ok i have done it with file() and file _get_contents() but...
4
by: sudhakaranr | last post by:
HI, Need your help please... First thing, i want to open a directory and with in the directory i have 1000's of files and we need to read the file and i want a particular line which has...
0
by: kdsutaia | last post by:
hi! I hv to read two files from two diff directories and need to count pairs of words from both the files. as well I hv to keep track of no of documents where this terms present. All files...
2
by: jai_python | last post by:
hi frenz I Need a Python Script For read multiple files(.txt) from a folder and write it in a single text file.... Thanks
9
by: kkhan5000 | last post by:
Hello, I am new to PHP and have put together the following code just by copying other examples from the web. Now I am stuck and would like to sort and display files alphabetically, and also filter...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.