troubleshooting Question

How to get printer driver name and port in C#

Avatar of rturney
rturneyFlag for United States of America asked on
C#
7 Comments1 Solution13841 ViewsLast Modified:
I am converting a large program from VB6 to C#.  One of the problems I've run into is the VB6 program uses the old Kodak Imaging Control.  I've not been able to find anything inexpensive to replace it with so I have got it running in the C# program.  The problem is that the print method for the Kodak image control requires the printer name, driver and port.  This was not much of a problem in VB6 and I used:

Private Sub cboPrinters_Click()
    With frmEView
        Set Printer = Printers(cboPrinters.ListIndex)
        .gstrPrnName = Printer.DeviceName
        .gstrPrnDriver = Printer.DriverName
        .gstrPrnPort = Printer.Port
    End With
End Sub

This used the Printers collection in VB6.  Does anyone know what needs to be done in C# to reveal the printer info.  Most of the printers are network printers and usually one local one.

Thanks,
-Bob
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros