Ťṓƴᶎ wrote:The for-each loop just lets you loop the multi files if someone drags say 5 instead of 1, also the switch loop helps prevent ram over head as it's disposing it's self every time unlike a if statement,
In the if statement I use tolower cause sometimes it is like TxT so it cannot equal txt adding tolower lets you make sure it equals always
There is the linq method you can do but not even I would use it as it's not memory efficiency
That's very true, I didn't even think of those people who insist on using mixed case letters in the extensions. I wonder if there is a way to combine the functionality of the for-each loop with the memory overhead prevention of the switch. That is something I'd be very interested in.
Edit:
string filetype = Path.GetExtension(filenames[0]).ToLower();
Will solve 1 problem.