send raw command to lpt or com port without installing the device

1.4k Views Asked by At

is there a way to send raw command like esc+something to print or to open cash drawer through lpt port or com port in c# .net , but the printer or cash drawer just plugged in and not installed in that computer(using win xp os) , so there is no printer name as a parameter, just lpt1 or com2 or com2 . Thanks

Thanks

1

There are 1 best solutions below

0
On

You don't have to install a driver for COM or LPT peripheral device if it has a real COM or LPT. You have to have just installed drivers for COM or LPT in your PC. If you have a USB 2 COM adapter, you have to install drivers for it. But as soon as you have a working COM alias like COM1 or COM10, COM11... you can send or recieve characters with no problem if you use a right configuration for transmission.

Check out SerialPort class. For parallel port check out this question.