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
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.