Tuesday, March 13, 2012

Sniff a file format

Hi all,

I would like to know if there is a way in the .NET Framework to detect the type of a file.
I want to know if a generic file is a TextFile or a Binary one.

nb: I don't want to rely on the file extension but i want to detect "looking" inside the file.

Thank you.maybe you could use a reader to read through the data and a regex to determine what kind of file it is and do whatever with it accordingly
Yes it's true i though this way but it would be great if an object in the framework made this stuff for me :)
I heard that objects as IMultiLang can detect the type of attachments so I think that there was a probability that .Net Framework implement a feature like this.

0 comments:

Post a Comment