I am looking to get the file type of a file without its extension. I have found some links noted below, but I when I use the code, it seems to always return ?应用程序/八位字节流?. I have tested Word 2007 documents and other file formats with no success.
只是一点点背景,我们将支持文档存储在数据库中,我想知道它们是什么文件格式。我们确实保存了扩展名,但有时它是该文件的错误扩展名。
我发现的一些链接:
http://stackoverflow.com/questions/1437382/get-file-type-in-net
我已经尝试了下面链接中的所有示例,但是没有运气。
http://stackoverflow.com/questions/58510/using-net-how-can-you-find-the-mime-type-of-a-file-based-on-the-file-signature
也许我做错了,任何帮助将不胜感激。
使用VS 2010,Windows 7,Oracle 11 DB。
谢谢
只是一点点背景,我们将支持文档存储在数据库中,我想知道它们是什么文件格式。我们确实保存了扩展名,但有时它是该文件的错误扩展名。
我发现的一些链接:
http://stackoverflow.com/questions/1437382/get-file-type-in-net
我已经尝试了下面链接中的所有示例,但是没有运气。
http://stackoverflow.com/questions/58510/using-net-how-can-you-find-the-mime-type-of-a-file-based-on-the-file-signature
也许我做错了,任何帮助将不胜感激。
使用VS 2010,Windows 7,Oracle 11 DB。
谢谢