954,132 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

help with file header

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

matika
Newbie Poster
19 posts since May 2004
Reputation Points: 15
Solved Threads: 0
 

Perhaps this will help?

http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=79


I am sure, you could get what you need from that code, in order to throw together a little class to do what you want.

tayspen
<Insert title here>
Team Colleague
1,622 posts since Jul 2005
Reputation Points: 84
Solved Threads: 99
 

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

plazmo
Posting Whiz in Training
207 posts since Aug 2005
Reputation Points: 23
Solved Threads: 16
 
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);

MrBenz
Newbie Poster
4 posts since May 2006
Reputation Points: 13
Solved Threads: 1
 

He wants to use the header of the file.

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

tayspen
<Insert title here>
Team Colleague
1,622 posts since Jul 2005
Reputation Points: 84
Solved Threads: 99
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You