System.IO.Ports.SerialPort.WriteLine C# (CSharp) Method

WriteLine() public method

public WriteLine ( string str ) : void
str string
return void
		public void WriteLine (string str)
		{
			Write (str + new_line);
		}

Usage Example

 public static string SMSDevice_Status(string comPort)
 {
     SerialPort port = new SerialPort();
     String operatorString = "Error";
     try
     {
         port.PortName = comPort;
         if (!port.IsOpen)
         {
             port.Open();
         }
         port.WriteLine("AT+CREG?\r");
         Thread.Sleep(2000);
         operatorString = port.ReadExisting();
         return operatorString;
     }
     catch
     {
         return operatorString;
     }
     finally
     {
         port.Close();
     }
 }
All Usage Examples Of System.IO.Ports.SerialPort::WriteLine