Click here to Skip to main content
16,005,467 members
Home / Discussions / C#
   

C#

 
AnswerRe: What is HandleCreated Event? Pin
Anthony Mushrow16-Nov-07 15:39
professionalAnthony Mushrow16-Nov-07 15:39 
GeneralRe: What is HandleCreated Event? Pin
SeeBees16-Nov-07 17:14
SeeBees16-Nov-07 17:14 
QuestionDatagridView - Combobox Pin
Dino2Dino16-Nov-07 12:44
Dino2Dino16-Nov-07 12:44 
AnswerRe: DatagridView - Combobox Pin
KennyPatel16-Nov-07 20:38
KennyPatel16-Nov-07 20:38 
QuestionBook on Regular Expressions Pin
Jeffrey Walton16-Nov-07 12:20
Jeffrey Walton16-Nov-07 12:20 
AnswerRe: Book on Regular Expressions Pin
Christian Graus16-Nov-07 18:46
protectorChristian Graus16-Nov-07 18:46 
QuestionC# code to validate that a file is an audio file Pin
TheGAPnoid16-Nov-07 12:04
TheGAPnoid16-Nov-07 12:04 
AnswerRe: C# code to validate that a file is an audio file Pin
Anthony Mushrow16-Nov-07 14:31
professionalAnthony Mushrow16-Nov-07 14:31 
Try reading the first few bytes of the file, and see if it matches up with the extension of the file.

MP3's for example, will probably start with their ID3 tag, so the first three bytes would be:

I D 3
49 44 43

WMA start with their tag, which seems to start with:

0 & ²
30 26 B2


So, you could gather a small database of the headers of the filetypes. And compare the first few bytes of the uploaded file, to the set of bytes you already have.

If you get a file with extension: mp3 and it starts with something other than 49 44 43, you can just say that the extension does not match the filetype. Though you'd have to investigate this further. Im not sure what an mp3 starts with if it has no tag (can you get an mp3 without an ID3 tag?)




My current favourite word is: PIE!

Good ol' pie, it's been a while.

QuestionRetrieve data from a database Pin
Steauaclau16-Nov-07 11:55
Steauaclau16-Nov-07 11:55 
AnswerRe: Retrieve data from a database Pin
SABhatti16-Nov-07 12:52
SABhatti16-Nov-07 12:52 
QuestionPassing values between the forms Pin
Steauaclau16-Nov-07 10:30
Steauaclau16-Nov-07 10:30 
AnswerRe: Passing values between the forms Pin
snorkie16-Nov-07 10:37
professionalsnorkie16-Nov-07 10:37 
GeneralRe: Passing values between the forms Pin
Colin Angus Mackay16-Nov-07 10:49
Colin Angus Mackay16-Nov-07 10:49 
GeneralRe: Passing values between the forms Pin
snorkie16-Nov-07 11:31
professionalsnorkie16-Nov-07 11:31 
AnswerRe: Passing values between the forms Pin
Giorgi Dalakishvili16-Nov-07 10:53
mentorGiorgi Dalakishvili16-Nov-07 10:53 
GeneralRe: Passing values between the forms Pin
Steauaclau16-Nov-07 12:18
Steauaclau16-Nov-07 12:18 
GeneralRe: Passing values between the forms Pin
Giorgi Dalakishvili17-Nov-07 6:14
mentorGiorgi Dalakishvili17-Nov-07 6:14 
QuestionAPI Directory Security Pin
snorkie16-Nov-07 9:53
professionalsnorkie16-Nov-07 9:53 
Questioniframe problems Pin
netJP12L16-Nov-07 9:51
netJP12L16-Nov-07 9:51 
Answercross post Pin
SABhatti16-Nov-07 12:48
SABhatti16-Nov-07 12:48 
QuestionDetermine Which Radio Button is Selected in Group Pin
Jeffrey Walton16-Nov-07 9:32
Jeffrey Walton16-Nov-07 9:32 
AnswerRe: Determine Which Radio Button is Selected in Group Pin
Judah Gabriel Himango16-Nov-07 9:52
sponsorJudah Gabriel Himango16-Nov-07 9:52 
GeneralRe: Determine Which Radio Button is Selected in Group Pin
Jeffrey Walton16-Nov-07 10:23
Jeffrey Walton16-Nov-07 10:23 
GeneralRe: Determine Which Radio Button is Selected in Group Pin
PIEBALDconsult16-Nov-07 12:24
mvePIEBALDconsult16-Nov-07 12:24 
AnswerRe: Determine Which Radio Button is Selected in Group Pin
KennyPatel16-Nov-07 19:00
KennyPatel16-Nov-07 19:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.