Solution for checking file type using magic number in file signature (.NET)?

I want to check the type of file loaded (suppose the file has the wrong extension).

I believe this can be done by checking the magic number of the file signature. Just like it is done in unix . Therefore, I think I need to read the first bytes of the file and compare them with magic number mappings (and I need to have mappings, and I need to support them).

So, I thought, maybe there is a class for this purpose? Or maybe someone did it and can share their ideas for a solution? Thanks

+3
source share
2 answers

, " ". , . - ( - , , , ), , , . XML HTML (.. SGML) , .

, , :

, .

+4

.net, , Windows gnu .

+3

Source: https://habr.com/ru/post/1788721/


All Articles