|
-
Jul 19th, 2009, 03:13 PM
#1
Thread Starter
Lively Member
Call a procedure depending on file extention
Hi.
How would i go about checking a file extention to see if it is either
'.exe' or '.ex_'
What i need to be able to do is that if the extention of the file is '.ex_' then that file is copied to another folder, or if the file extention is '.exe' then it is passed onto another routine that will compress is.
Baring in mind that there could be a number of files in that folder.
I already have a routine that will compress the files, just need the above.
Many Thanks
tstrike
-
Jul 19th, 2009, 03:31 PM
#2
Re: Call a procedure depending on file extention
Use the System.IO.Path.GetExtension method to get the extension of a file. Do a simple comparison against the extensions you want to handle, and call different methods based on the comparison.
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
|