|
-
May 20th, 2002, 10:19 AM
#1
Thread Starter
Junior Member
Using wildcards....
Ok, guys: Here's another one to ponder....
I'm converting an old program which relied on the old FileListBox control in VB5. The program relied on the fact that I could stick wildcards in the FileListBox.Pattern property to list files matching a certain criteria so that I knew their full names for the program's processing routine.
In VB.Net, the only way of getting a filedump of a directory that gives me filenames that I can reference to arithmetically is by using a ListBox control like this:
-------------------------------------------------------------------------------
Dim Directory = "c:\"
Dim File As String
Me.ListBox1.Items.Clear()
Dim Files() As String = System.IO.Directory.GetFiles(directory)
For Each file In files
Me.ListBox1.Items.Add(file)
Next
-------------------------------------------------------------------------------
Which would in the above case list all the files contained within "c:\".
Now, before I start writing laborious code to validate each filename against the search criteria (which takes the form of a masked filename like "dw*.tiff" or "*.exe"). Is there an easy way of applying the filemask (or Pattern) to the above code and get VB.Net to do some work FOR me for a change??!?
Darren.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|