I need direct-to-printer functionality for my website, with the ability to distinguish a physical printer from a virtual printer (file).
Coupons.com has this functio
I know how to do it very easily on Win32. There is a structure called PRINTER_INFO_2 which has a field called pPortName. You can string compare it with the string "FILE" and get all the queues which are connected to the "FILE" port. And you can similarly add in more parsing logic for detecting other virtual printers. This structure is filled up by Windows when you call GetPrinter with the printer handle. Now the question is how to do it in .NET. I saw one way which is using marshalling. I saw some code snippets in http://vbcity.com/forums/t/66183.aspx. You can also look at C# interop using pInvoke. http://pinvoke.net/default.aspx/Structures/PRINTER_INFO_2.html
Hope this helps.