About streamreader
Dear all,
In my c# program,I have define a thread,the method is:
public static void ReadResponseThread()
{
StreamReader sr = new StreamReader(ss, System.Text.Encoding.ASCII);
//ss is a class instance,defined as:public class SerialStream : Stream
//{...} SerialStream is a class to operate com port
// static SerialStream ss;
try {
// Read response from com
string response = sr.ReadLine();
Console.WriteLine("Response: " + response);
}
catch (ThreadAbortException)
{}
}
I use it like this:
Thread responseReaderThread = new Thread(new ThreadStart (ReadResponseThread));
responseReaderThread.Start();
But program will stop(not dead,not the style of breakpoint) at line:string response=sr.ReadLine(),and no error.
Of course,I can not receive any data form com port.
What can i do?