System.IO.Ports.SerialPort.ReadLine C# (CSharp) Méthode

ReadLine() public méthode

public ReadLine ( ) : string
Résultat string
		public string ReadLine ()
		{
			return ReadTo (new_line);
		}

Usage Example

Exemple #1
0
        public bool ParseResponse(SerialPort serialPort)
        {
            try
            {
                StringBuilder sb = new StringBuilder(capacity: 50000);

                var s = serialPort.ReadLine();

                while (true)
                {
                    s = serialPort.ReadLine().Trim();

                    if (string.IsNullOrEmpty(s))
                        continue;

                    if (s == "OK") break;

                    sb.Append(s);
                }

                string bigStr = sb.ToString();

                SnapshotImage = MakeBitmap(bigStr);

                return true;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); return false; }
        }
All Usage Examples Of System.IO.Ports.SerialPort::ReadLine