Click here to Skip to main content
15,894,539 members
Home / Discussions / C#
   

C#

 
GeneralRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
MarkB7779-Jun-08 17:49
MarkB7779-Jun-08 17:49 
AnswerRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
Joe Woodbury9-Jun-08 19:30
professionalJoe Woodbury9-Jun-08 19:30 
AnswerRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
Ashfield9-Jun-08 21:24
Ashfield9-Jun-08 21:24 
QuestionBind a Datatable With an Hyperlink Column To a GridView Pin
HatakeKaKaShi9-Jun-08 16:51
HatakeKaKaShi9-Jun-08 16:51 
QuestionBinary Reader Scanning for string Pin
Jammer9-Jun-08 15:12
Jammer9-Jun-08 15:12 
AnswerRe: Binary Reader Scanning for string Pin
Insincere Dave9-Jun-08 17:21
Insincere Dave9-Jun-08 17:21 
GeneralRe: Binary Reader Scanning for string Pin
Jammer10-Jun-08 3:22
Jammer10-Jun-08 3:22 
AnswerRe: Binary Reader Scanning for string Pin
Guffa10-Jun-08 12:02
Guffa10-Jun-08 12:02 
Why on earth are you reading the file four characters at a time, looking for an identifier? The file is organised into chunks, where the four character identifier is followed by an int containing the size of the chunk. Just read the chunk size and use that to skip to the next chunk, instead of reading throught the chunk four characters at a time.

Besides, there is no guarantee that the chunk size is a multiple of four, so using that method you may just as well miss the next identifier.

Also, you are catching exceptions and just ignoring them, you should never do that. If you re-throw the exception, you will probably find that when the method takes long time to run, you have missed the data identifier so that you are reading the entire file, and then continue to try to read way past the end of the file, as your loop runs for four times the size of the file.

Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: Binary Reader Scanning for string Pin
Jammer10-Jun-08 12:17
Jammer10-Jun-08 12:17 
GeneralRe: Binary Reader Scanning for string Pin
Jammer10-Jun-08 13:36
Jammer10-Jun-08 13:36 
GeneralRe: Binary Reader Scanning for string Pin
Guffa10-Jun-08 20:32
Guffa10-Jun-08 20:32 
GeneralRe: Binary Reader Scanning for string Pin
Jammer11-Jun-08 9:21
Jammer11-Jun-08 9:21 
QuestionForm Inheritance Pin
Dirso9-Jun-08 13:31
Dirso9-Jun-08 13:31 
AnswerRe: Form Inheritance Pin
MarkB7779-Jun-08 13:48
MarkB7779-Jun-08 13:48 
GeneralRe: Form Inheritance Pin
Dirso9-Jun-08 14:32
Dirso9-Jun-08 14:32 
GeneralRe: Form Inheritance Pin
MarkB7779-Jun-08 16:16
MarkB7779-Jun-08 16:16 
GeneralRe: Form Inheritance Pin
Dirso10-Jun-08 2:05
Dirso10-Jun-08 2:05 
GeneralRe: Form Inheritance Pin
MarkB77710-Jun-08 2:28
MarkB77710-Jun-08 2:28 
GeneralRe: Form Inheritance Pin
Dirso10-Jun-08 2:47
Dirso10-Jun-08 2:47 
GeneralRe: Form Inheritance Pin
MarkB77710-Jun-08 2:59
MarkB77710-Jun-08 2:59 
GeneralRe: Form Inheritance Pin
Dirso10-Jun-08 10:30
Dirso10-Jun-08 10:30 
GeneralRe: Form Inheritance (still can't edit) Pin
Dirso10-Jun-08 12:20
Dirso10-Jun-08 12:20 
QuestionCalling an Extension method from another Extension method (C# 3.0) Pin
Rajesh Moriyani9-Jun-08 12:43
Rajesh Moriyani9-Jun-08 12:43 
AnswerRe: Calling an Extension method from another Extension method (C# 3.0) Pin
jamie5509-Jun-08 13:08
jamie5509-Jun-08 13:08 
AnswerRe: Calling an Extension method from another Extension method (C# 3.0) Pin
Tariq A Karim9-Jun-08 16:39
Tariq A Karim9-Jun-08 16:39 

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.