Click here to Skip to main content
15,898,819 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to use desktop composition + C# Pin
jojoba201125-Jun-12 17:51
jojoba201125-Jun-12 17:51 
Questionascii to decimal Pin
Member 916404524-Jun-12 8:29
Member 916404524-Jun-12 8:29 
AnswerRe: ascii to decimal Pin
Luc Pattyn24-Jun-12 8:53
sitebuilderLuc Pattyn24-Jun-12 8:53 
AnswerRe: ascii to decimal Pin
NeonMika24-Jun-12 10:29
NeonMika24-Jun-12 10:29 
GeneralRe: ascii to decimal Pin
Member 916404524-Jun-12 17:08
Member 916404524-Jun-12 17:08 
AnswerRe: ascii to decimal Pin
Luc Pattyn24-Jun-12 17:50
sitebuilderLuc Pattyn24-Jun-12 17:50 
GeneralRe: ascii to decimal Pin
Basim 227-Jun-12 10:21
Basim 227-Jun-12 10:21 
AnswerRe: ascii to decimal Pin
Luc Pattyn27-Jun-12 11:17
sitebuilderLuc Pattyn27-Jun-12 11:17 
Hi,

I'm not going to download a huge file to glance at one or two pages of it, sorry.

Your DataReceived code needs some changes:

1. I would output the value of count;
2. you should display count bytes, which may be fewer than your buffer's capacity.
3. when data is binary, I always prefer a hex printout; decimal is useless most of the time.
4. the bytes output need a fixed number of characters, otherwise you don't know whether "123" means "12"+"3" or "1"+"23" or ...

In my experience the return on investment for observation tools is immediate, so I suggest you try something like this:
int count = serialPort1.Read(buffer, 0, buffer.Length);
for (int i = 0; i < count; i++) {
    if (i%8==0) sw.Write(" ");
    sw.Write(buffer[i].ToString("X2"));
    sw.Write(" ");
}


Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: ascii to decimal Pin
Richard MacCutchan24-Jun-12 22:35
mveRichard MacCutchan24-Jun-12 22:35 
GeneralRe: ascii to decimal Pin
Basim 225-Jun-12 4:41
Basim 225-Jun-12 4:41 
QuestionUnhanded Exception Error Pin
Saidrex23-Jun-12 22:42
Saidrex23-Jun-12 22:42 
AnswerRe: Unhanded Exception Error Pin
Sandeep Mewara23-Jun-12 22:57
mveSandeep Mewara23-Jun-12 22:57 
GeneralRe: Unhanded Exception Error Pin
Saidrex23-Jun-12 23:36
Saidrex23-Jun-12 23:36 
GeneralRe: Unhanded Exception Error Pin
Sandeep Mewara24-Jun-12 2:28
mveSandeep Mewara24-Jun-12 2:28 
GeneralRe: Unhanded Exception Error Pin
Saidrex24-Jun-12 2:32
Saidrex24-Jun-12 2:32 
AnswerRe: Unhanded Exception Error Pin
Eddy Vluggen23-Jun-12 23:40
professionalEddy Vluggen23-Jun-12 23:40 
GeneralRe: Unhanded Exception Error Pin
Saidrex24-Jun-12 0:09
Saidrex24-Jun-12 0:09 
GeneralRe: Unhanded Exception Error Pin
Eddy Vluggen24-Jun-12 0:14
professionalEddy Vluggen24-Jun-12 0:14 
GeneralRe: Unhanded Exception Error Pin
Saidrex24-Jun-12 0:17
Saidrex24-Jun-12 0:17 
GeneralRe: Unhanded Exception Error Pin
Eddy Vluggen24-Jun-12 0:25
professionalEddy Vluggen24-Jun-12 0:25 
GeneralRe: Unhanded Exception Error Pin
Saidrex24-Jun-12 0:32
Saidrex24-Jun-12 0:32 
GeneralRe: Unhanded Exception Error Pin
jschell24-Jun-12 12:27
jschell24-Jun-12 12:27 
QuestionDelete specific rows from database tables Pin
Saidrex23-Jun-12 10:16
Saidrex23-Jun-12 10:16 
AnswerRe: Delete specific rows from database tables Pin
Abhinav S23-Jun-12 18:22
Abhinav S23-Jun-12 18:22 
GeneralRe: Delete specific rows from database tables Pin
Saidrex23-Jun-12 22:37
Saidrex23-Jun-12 22:37 

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.