Click here to Skip to main content
15,912,977 members
Home / Discussions / C#
   

C#

 
GeneralRe: VS2017 : selecting files, then applying search/replace ? Pin
BillWoodruff8-Jun-17 3:26
professionalBillWoodruff8-Jun-17 3:26 
GeneralRe: VS2017 : selecting files, then applying search/replace ? Pin
ZurdoDev8-Jun-17 5:57
professionalZurdoDev8-Jun-17 5:57 
GeneralRe: VS2017 : selecting files, then applying search/replace ? Pin
BillWoodruff8-Jun-17 8:22
professionalBillWoodruff8-Jun-17 8:22 
QuestionCondition of C#. Pin
Member 113461537-Jun-17 22:11
Member 113461537-Jun-17 22:11 
AnswerRe: Condition of C#. Pin
Richard MacCutchan7-Jun-17 22:39
mveRichard MacCutchan7-Jun-17 22:39 
AnswerRe: Condition of C#. Pin
OriginalGriff7-Jun-17 22:55
mveOriginalGriff7-Jun-17 22:55 
QuestionFetching data from multiple mailboxes Pin
Member 132459727-Jun-17 4:23
Member 132459727-Jun-17 4:23 
AnswerRe: Fetching data from multiple mailboxes Pin
OriginalGriff7-Jun-17 8:06
mveOriginalGriff7-Jun-17 8:06 
AnswerRe: Fetching data from multiple mailboxes Pin
F-ES Sitecore7-Jun-17 22:47
professionalF-ES Sitecore7-Jun-17 22:47 
GeneralRe: Fetching data from multiple mailboxes Pin
Member 113461538-Jun-17 3:52
Member 113461538-Jun-17 3:52 
QuestionMissing data on Windows App form C# Pin
Member 131317266-Jun-17 23:33
Member 131317266-Jun-17 23:33 
AnswerRe: Missing data on Windows App form C# Pin
Jochen Arndt7-Jun-17 1:46
professionalJochen Arndt7-Jun-17 1:46 
GeneralRe: Missing data on Windows App form C# Pin
Member 131317267-Jun-17 2:47
Member 131317267-Jun-17 2:47 
GeneralRe: Missing data on Windows App form C# Pin
Gerry Schmitz7-Jun-17 3:16
mveGerry Schmitz7-Jun-17 3:16 
GeneralRe: Missing data on Windows App form C# Pin
Jochen Arndt7-Jun-17 3:26
professionalJochen Arndt7-Jun-17 3:26 
AnswerRe: Missing data on Windows App form C# Pin
Luc Pattyn8-Jun-17 13:44
sitebuilderLuc Pattyn8-Jun-17 13:44 
Hi,

your job is quite a challenge: with loads of data incoming at high rate and no way to stop the producer, the consumer (i.e. your PC program) needs to be designed and coded carefully and economically to obtain an acceptable probability of it keeping up with the producer under normal circumstances.

1. I do agree with what others said about using threads, not timers.

2. I do not like your approach of turning all data into strings, such conversion is time consuming and unnecessary, the one positive thing about it is it is easy and quite readable. If incoming data is binary, you should keep it binary at all times IMO. And your file should be binary too, unless there are forcing reasons against that.

3. Moreover, your code seems to be wasting huge amounts of computer cycles; there are dozens of calls to ByteArrayToHexString(buffer) all performing the same expensive job; and then a lot of them only are interested in a small part of the result, e.g. ByteArrayToHexString(buffer).Substring(16, 8); so why convert everything?
If you insist on having a conversion, either perform it once and store the result, or only convert the part you're interested in (i.e. pass startIndex and Length to the conversion method).

4. As you are basically performing two jobs (display and storage) and missing 30% of the data, it must be hard to figure out exactly where it goes wrong when it does. So I would suggest you concentrate on one job until that works perfectly; then do the other job, and finally combine them.



I hope this helps; I do realize my suggestions may imply a lot of work, and the need for a lot more code.
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: Missing data on Windows App form C# Pin
Member 1313172611-Jun-17 20:41
Member 1313172611-Jun-17 20:41 
GeneralRe: Missing data on Windows App form C# Pin
Luc Pattyn12-Jun-17 6:15
sitebuilderLuc Pattyn12-Jun-17 6:15 
GeneralRe: Missing data on Windows App form C# Pin
Member 1313172612-Jun-17 20:39
Member 1313172612-Jun-17 20:39 
GeneralRe: Missing data on Windows App form C# Pin
Luc Pattyn12-Jun-17 23:42
sitebuilderLuc Pattyn12-Jun-17 23:42 
QuestionJson parser error when converting iphone images from bytes to base64 string in a MVC JsonResult Pin
jkirkerx6-Jun-17 10:22
professionaljkirkerx6-Jun-17 10:22 
AnswerRe: Json parser error when converting iphone images from bytes to base64 string in a MVC JsonResult [solved] Pin
jkirkerx6-Jun-17 12:49
professionaljkirkerx6-Jun-17 12:49 
SuggestionRe: Json parser error when converting iphone images from bytes to base64 string in a MVC JsonResult [solved] Pin
Richard Deeming7-Jun-17 0:57
mveRichard Deeming7-Jun-17 0:57 
GeneralRe: Json parser error when converting iphone images from bytes to base64 string in a MVC JsonResult [solved] Pin
jkirkerx7-Jun-17 6:33
professionaljkirkerx7-Jun-17 6:33 
QuestionCreate a chart in PowerPoint using C#. Pin
Member 126813284-Jun-17 22:30
Member 126813284-Jun-17 22:30 

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.