opening file

hi guys i'm trying to check if a file is a .png or a .bmp
i know how to check to see if the path filename is a .png or .bmp but people can edit the file extension and make the program unusable.
i opened up my png in a hex editor and the first 4 letters are .PNG or 89 50 4E 47 in hex
is there any way i can check to see if those values match without installing any fancy libs?
Of course... just read the first four bytes of the file in question and see if they match.
What is the problem?
Ugh...definitely a spammer.
Topic archived. No new replies allowed.