none
How to find the available Fax and printers through C# application

    Question

  • Hi all,

                    I want to display all available Fax machines and Printers installed on my machine in a dropdown box and based on the selection of one item, that selected printer or fax should become the default printer to my machine. How can I do this by using C#.

     

                        Please help me out.

     

     

    Thanks and Regards

    Ravinder Reddy K

    Monday, July 02, 2007 6:32 AM

Answers

  • Import System.Drawing.Printing namespace in your application.

    Add a DropDownList and change its name to printersList and write this below code on Form's load event handler.

    private void Form1_Load (object sender, System.EventArgs e)

    {

    foreach (String printer in PrinterSettings.InstalledPrinters)

    {

    printersList.Items.Add (printer.ToString());

    }

    }

    The DropDownList will show all printers available on your network.

    Monday, July 02, 2007 6:45 AM
  • check this link for printers..http://www.c-sharpcorner.com/UploadFile/DipalChoksi/WindowsFormPrinterSelectionList11222005002533AM/WindowsFormPrinterSelectionList.aspx

     

    I don't have idea about fax machine

    Monday, July 02, 2007 7:11 AM

All replies

  • Import System.Drawing.Printing namespace in your application.

    Add a DropDownList and change its name to printersList and write this below code on Form's load event handler.

    private void Form1_Load (object sender, System.EventArgs e)

    {

    foreach (String printer in PrinterSettings.InstalledPrinters)

    {

    printersList.Items.Add (printer.ToString());

    }

    }

    The DropDownList will show all printers available on your network.

    Monday, July 02, 2007 6:45 AM
  • Thank you Karthikeya. Then what about FAX machines? and after selecting one printer how can I make it as the default printer?
    Monday, July 02, 2007 6:49 AM
  • check this link for printers..http://www.c-sharpcorner.com/UploadFile/DipalChoksi/WindowsFormPrinterSelectionList11222005002533AM/WindowsFormPrinterSelectionList.aspx

     

    I don't have idea about fax machine

    Monday, July 02, 2007 7:11 AM