0

I use this code for get extensions in c# windows application:

FileInfo oFile = new FileInfo(file);
string strType = oFile.Extension;

its working.

but, If the user has changed the file extension, its not working.

This method displays the appearance extension. please help me for another method.

mico nino
  • 11
  • 2
  • There is no MacOS equivalent of file types in Windows. The extension is a hint to the OS as to the filetype, if the user changes the extension, they had better know what they are doing. – NetMage Oct 09 '18 at 22:09

1 Answers1

0

If the user changes the file extension, then your data is now stale. You may want to subscribe to file change events. See this post for more information.

sean
  • 367
  • 2
  • 12