-
May 31st, 2007, 11:08 AM
#1
[RESOLVED] How to accept an input file without knowing it's name?
I know how to use a command line parameter to allow the user to enter the name of a specific file. But what if you only know the extension, or want every file with the given extension to be processed?
Say for example on a command line prompt the user enters the name of the exe and then *.jpg as the parameter, how can I process every file with a jpg extension? I know about regular expressions, but I don't know how to accomplish this particular problem.
-
May 31st, 2007, 04:29 PM
#2
Re: How to accept an input file without knowing it's name?
Code:
Dim Files() As String = System.IO.Directory.GetFiles("C:\somedirectory", "*.jpg")
For Each file As String In Files
'do something
Next
-
June 1st, 2007, 09:41 AM
#3
Re: How to accept an input file without knowing it's name?
Well, That sure seemed simple enough. LOL. Thanks!
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
|