.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

Get all printers

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :.NET Framework
I use the following code to get all the installed printers in my computer It works well when I put the code in a windows form application, all the printers including the network printers can be found but when I put it in a windows service application it can't get the network printer, please help     ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_Printer");   ManagementObjectCollection collection = searcher.Get();   foreach (ManagementObject currentObject in collection) {   string description = currentObject["name"].ToString().Trim();   if ((bool)currentObject["Default"]) { txtCurrentPrinter.Text = description; txtSelectPrinter.Text = description; lstBxPrinter.Items.Add(description); lstBxPrinter.SelectedItem = description; }   else { lstBxPrinter.Items.Add(description); } }

View Complete Post

More Related Resource Links

How to update my app when system.printers changed






I want to show printer status in my app, on my mainform...

Its ok..

I use this code:


  status_printer.Text = "Printer: " & PrintDocument1.PrinterSettings.PrinterName

I want to change this when system printer changed... How to i add this in my app or how to reload my mainform when system printers settings changes...

Thank you for your helps and understandings even my english.



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend