I'm trying to find out how to get the file type (like in Explorer) for each
file within the directory.
Is there a relatively easy way to make that happen?
Ben Dewey - 21 Dec 2005 17:42 GMT
you can use:
string filename = @"c:\test.txt";
System.IO.Path.GetExtension(filename);
returns ".txt" if you just want the extension part use:
System.IO.Path.GetExtension(filename).Trim('.');
What kind of File Type are you looking for?