ITCOOKBOOK.com

 Options

Current Time:
Thu Sep 09, 2010 10:20 am
View unanswered posts

Log in

Username:
Password:
Log me on automatically each visit

Topic Information

C# file list box

 
Post new topic   Reply to topic    ITCOOKBOOK.com Forum Index -> C#
View previous topic :: View next topic  
Author Message
maryh
Member


Joined: 30 Nov 2006
Posts: 21

PostPosted: Fri Dec 01, 2006 9:19 pm    Post subject: C# file list box Reply with quote

I am using a ‘filelistbox’ in a c# program (“openfiledialog” doesn’t work for me) and I need to have the ability to count how many items are contained in the listbox.

I have:

Code:
string[] flbItems = Directory.GetFiles(this.strSourcePath);


which should give me an array that contains every file.

Then, I have:

Code:
 for (int x = 0; x < flbItems.GetLength(1); x++)

which should loop as many times as there are files. These two things do not seem to work though, the program just crashes with no error message.

What I am trying to do (say, I have these files):

45445423.tif
42323455.jpg
43214141.png
44232442h.gif
adddddcq.pdf

I need to be able to remove all files that contain a non-numeric character. So, the “44232442h.gif” and “adddddcq.pdf” should stay, but I want to remove the rest.

How can I loop through the items in the ‘filelistbox’ to check them, and remove files that shouldn’t be shown?
_________________
*MaryHeider*
Network Specialist
Pacfic Gas & Electric
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ITCOOKBOOK.com Forum Index -> C# All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Help US Help YOU

 

 

Please complete our short survey and save $17.50 on ITCOOKBOOK.COM.

 

 

Take a look at SAPTrends.com, a new blog dedicated to discussion of SAP Training trends in SAP ERP.

 

 

C# Interview Questions

 

.NET Interview Questions

 

Java Interview Questions

 

Python Interview Questions

 

ColdFusion Interview Questions

 

Linux Interview Questions

 

Linux LPIC 1 Certification Questions

 

Perl Programming Interview Questions