help in c sharp

  • Thread starter Thread starter asif
  • Start date Start date
A

asif

i am new with c sharp....
can u please tell me what is wrong here....


try
{
//message = _serialPort.ReadLine();

if (_serialPort.ReadLine()== "asif")
{
_serialPort.WriteLine("asif is there:");
}
else
{
_serialPort.WriteLine("someone is there:");
}

}
catch (TimeoutException) { }
}


it always go to the else part....
i will be thank ful...
 
asif said:
i am new with c sharp....
can u please tell me what is wrong here....


try
{
//message = _serialPort.ReadLine();

if (_serialPort.ReadLine()== "asif")
{
_serialPort.WriteLine("asif is there:");
}
else
{
_serialPort.WriteLine("someone is there:");
}

}
catch (TimeoutException) { }
}


it always go to the else part....
i will be thank ful...

Well, what are you doing that would make you expect it to receive
"asif"? If you uncomment the "message" line, what's the value of
message?
 
Back
Top