Guest User

Untitled

a guest
Jan 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. try
  2. {
  3. _printPort = new SerialPort(PrinterCOMPort, 19200, Parity.None, 8, StopBits.One);
  4. //_printPort.PortName = "COM3";
  5. //_printPort.BaudRate = 9600;
  6. //_printPort.Parity = Parity.None;
  7. //_printPort.DataBits = 8;
  8. //_printPort.StopBits = StopBits.One;
  9. //_printPort.Handshake = Handshake.None;
  10.  
  11. // Set the read/write timeouts / Buffer Size
  12. _printPort.ReadTimeout = 500;
  13. _printPort.WriteTimeout = 500;
  14. _printPort.WriteBufferSize = 1000000000;
  15. _printPort.ReadBufferSize = 1000000000;
  16.  
  17. _printPort.Open();
  18. }
  19.  
  20. catch (System.Exception excep)
  21. {
  22. MessageBox.Show("Error establishing connection with label printer:n" + excep.Message);
  23. }
Add Comment
Please, Sign In to add comment