Writing a dummy Network Shared Printer
I want to write a dummy printer driver which appears as a shared printer on a LAN and can accept print jobs; so when its installed on a computer other computers in the LAN can browse and add it as a usual shared network printer and send print jobs to it. I want to do this in c#, are there any better suggestions?
Can anyo开发者_StackOverflow社区ne tell me any information regarding this, tips, tools, reading material etc. anything!
If you just want a printer that will accept jobs and not do anything with the data, you don't need to write your own printer driver. Just create a local printer, and when it asks you for the port create a new local port and give it the name NUL. From the Windows XP Professional Product Documentation:
If the printer is physically attached to the print server, select the appropriate local port. LPT1 through LPT3 represent parallel ports; COM1 through COM4 represent serial ports When a client prints to a printer port denoted as FILE, the client is prompted for the file name. If you decide to add a new local port you can enter one of the following:
- A file name, such as C:\Dir\Filename. All jobs sent to this port are written to the named file, and each new job overwrites the last one.
The share name of a printer, such as \Server\Printer (URLs are not accepted). Jobs sent to this port are transferred over the network to the named share by the network redirector.
NUL. This specifies the null port, which you can use to test whether network clients can send jobs. Jobs sent to NUL are deleted without wasting paper or delaying real print jobs.
- IR. Use this port to connect to infrared-enabled printers meeting Infrared Data Association (IrDA) specifications. If your hardware does not support IR, it will not be listed on the Ports tab.
精彩评论