Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2004, 12:22 PM
Authorized User
 
Join Date: Aug 2003
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
Default Help Enumerate local Printer Share Names

All-

I need help figuring out how to enumerate local printer share names in either VB.NET or C#.

I can enumerate the printer names easily (I put my code to do this below in case someone might want it), but this does not get me the share names. I need the share names to print some raw print data to the printer.

If you can help, I'd appreciate it.
Hubman

My code to enumerate printer names:

Public Function GetPrinterList() As String
    Dim PrinterName As String = ""
    Dim objPrint As New System.Drawing.Printing.PrinterSettings
    Dim i As Integer = 0
    Dim Printers() As String

    For Each PrinterName In objPrint.InstalledPrinters
        ReDim Preserve Printers(i)
        Printers(i) = PrinterName
        i += 1
    Next

    If Printers.Length > 0 Then
        Return Printers
    Else
        Return Nothing
    End If
End Function





Similar Threads
Thread Thread Starter Forum Replies Last Post
enumerate db2 server... sal21 VB Databases Basics 0 February 6th, 2007 07:39 AM
process could not enumerate changes at the subscri rstelma SQL Server 2000 2 June 21st, 2006 09:50 PM
Can I enumerate through the classes in a Namespace MAtkins General .NET 3 August 1st, 2005 11:58 AM
Crystal Report is not printed to the local printer pratyush_k Crystal Reports 0 June 29th, 2005 09:07 AM
Enumerate SQL data sources RFickling C# 0 May 22nd, 2005 10:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.