Click here to Skip to main content
15,896,118 members
Home / Discussions / C#
   

C#

 
NewsRe: auto sleep/wakeup windows 7 at specified times Pin
Eddy Vluggen15-Aug-12 11:41
professionalEddy Vluggen15-Aug-12 11:41 
AnswerRe: auto sleep/wakeup windows 7 at specified times Pin
OriginalGriff15-Aug-12 20:42
mveOriginalGriff15-Aug-12 20:42 
AnswerRe: auto sleep/wakeup windows 7 at specified times Pin
lordrt16-Aug-12 5:38
lordrt16-Aug-12 5:38 
QuestionHaving Problem with small Function Pin
computerpublic15-Aug-12 8:11
computerpublic15-Aug-12 8:11 
AnswerRe: Having Problem with small Function Pin
Dave Kreskowiak15-Aug-12 8:14
mveDave Kreskowiak15-Aug-12 8:14 
GeneralRe: Having Problem with small Function Pin
computerpublic15-Aug-12 9:06
computerpublic15-Aug-12 9:06 
GeneralRe: Having Problem with small Function Pin
Wes Aday15-Aug-12 9:43
professionalWes Aday15-Aug-12 9:43 
GeneralRe: Having Problem with small Function Pin
harold aptroot15-Aug-12 10:20
harold aptroot15-Aug-12 10:20 
AnswerRe: Having Problem with small Function PinPopular
Bernhard Hiller15-Aug-12 22:54
Bernhard Hiller15-Aug-12 22:54 
AnswerRe: Having Problem with small Function Pin
DaveyM6916-Aug-12 1:37
professionalDaveyM6916-Aug-12 1:37 
QuestionDelegate w/ Lambda Pin
Herrwolf115-Aug-12 4:43
Herrwolf115-Aug-12 4:43 
AnswerRe: Delegate w/ Lambda Pin
BobJanova15-Aug-12 5:04
BobJanova15-Aug-12 5:04 
GeneralRe: Delegate w/ Lambda Pin
Eddy Vluggen15-Aug-12 5:19
professionalEddy Vluggen15-Aug-12 5:19 
GeneralRe: Delegate w/ Lambda Pin
Herrwolf115-Aug-12 8:54
Herrwolf115-Aug-12 8:54 
AnswerRe: Delegate w/ Lambda Pin
Dave Doknjas15-Aug-12 10:21
Dave Doknjas15-Aug-12 10:21 
GeneralRe: Delegate w/ Lambda Pin
Herrwolf115-Aug-12 10:54
Herrwolf115-Aug-12 10:54 
QuestionSending SMS through ASP.NET Pin
komalridda14-Aug-12 20:00
komalridda14-Aug-12 20:00 
AnswerRe: Sending SMS through ASP.NET Pin
OriginalGriff14-Aug-12 20:42
mveOriginalGriff14-Aug-12 20:42 
AnswerCross Post Pin
DaveyM6914-Aug-12 23:24
professionalDaveyM6914-Aug-12 23:24 
AnswerRe: Sending SMS through ASP.NET Pin
Keith Barrow15-Aug-12 2:08
professionalKeith Barrow15-Aug-12 2:08 
QuestionSave Excel File Pin
Member 916988714-Aug-12 15:21
Member 916988714-Aug-12 15:21 
AnswerRe: Save Excel File Pin
Dave Kreskowiak14-Aug-12 18:13
mveDave Kreskowiak14-Aug-12 18:13 
AnswerRe: Save Excel File Pin
Eddy Vluggen15-Aug-12 1:23
professionalEddy Vluggen15-Aug-12 1:23 
QuestionAbout SerialPort Pin
SODMi14-Aug-12 15:18
SODMi14-Aug-12 15:18 
Ladies And Gentlemen:
Here I use a SerialPort to send and receive message(of Bytes).
But it cannot really work.
MCU can send a string to PC, and PC can send a string to MCU too.
The problem is , when PC sent a string first,later when you about to send a string to PC from MCU ,it losts a byte,the first or the second one.
C#
private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
    //lock1.AcquireWriterLock(-1);
    int temp = serialPort1.ReadByte();

    //Console.WriteLine("temp是:" + temp);

    //验证是否是合法地址
    if (IsAddrConfirmed == 0 && NeedAddrConfirm == 1)
    {
        IsAddr = confirmAddr((byte)temp);
        IsAddrConfirmed = 1;
        ////Console.WriteLine("地址已经验证:"+CurrentAddr);
    }

    //if (temp != 63 && !IsAddr && AddrBacked_2 == 1)
    if (!IsAddr && AddrBacked_2 == 1)
    {
        try
        {
            textBox3.Text += "temp是:" + temp + "\r\n";
            //textBox3.Text += "收到字符串:" + serialPort1.ReadLine()+"\r\n";
            textBox3.Text += "收到字符串:" + (char)temp + serialPort1.ReadLine() + "\r\n";

When dataReceived,temp got a value
Look at the last two or three lines ,is it the point?
Thank you very much,but sorry for my bad English.
Little bird looking for heros

AnswerRe: About SerialPort Pin
Roger Wright14-Aug-12 20:08
professionalRoger Wright14-Aug-12 20:08 

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.