hiii all
do any1 knows how to read the header of a file to know its format
as example if i've a mp3 file but it's name do not include .mp3
i wanna make a program that read the header of the file and detect it's format but i dont know how to read the header in c#
plzzzzzzzz help anythng u send could help :)
tnx

I tried this a while ago, and its not 100% possible because i think not all files contain a header or such that says what the file is

hiii all
do any1 knows how to read the header of a file to know its format
as example if i've a mp3 file but it's name do not include .mp3
i wanna make a program that read the header of the file and detect it's format but i dont know how to read the header in c#
plzzzzzzzz help anythng u send could help :)
tnx

try.....string extension = Path.GetExtension(file);

He wants to use the header of the file.

What if for some reason it has no extension? Then that way won't work ;).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.