c# - Error The Write timed out -
can tell me wrong code? code in c#... gives me error "the write timed out", set writetimeout...
i want write data serial port. use .net framework 3.5
} serialport sp = new serialport("com6", 9600, system.io.ports.parity.none, 8, system.io.ports.stopbits.one); sp.writetimeout = 500; sp.open(); try { sp.write("hello"); } catch (timeoutexception) { console.writeline("error"); } sp.close(); console.readkey(); }
thanks
Comments
Post a Comment