title: How to read data from serial port in vb.net?
body: <p>I made a class and there is this sub named SendUSSD, when this is called it sends a ussd code like *123# to a COM port where a gsm mobile is connected. This ussd is supposed to return the mobile balance. </p>
  
  <pre><code>If IsOpen = True Then 'checks if the port is open
              SMSPort.WriteLine("AT+CUSD=1,""*123#""" vbCr) 'this sends the ussd code
              Form1.TextBox2.Text = SMSPort.ReadLine().ToString() 'this shows the response
  End If
  </code></pre>
  
  <p>Now the problem is sometimes I get the full response like "Your current balance is so and so". But, most of the time I get a part of the message like "Your curr". My guess is that it takes some time to get the response, so how do I make this Form1.TextBox2.Text = SMSPort.ReadLine().ToString() line wait until the last character which is a full-stop to appear and then execute the line?</p>