?
Solved

Get installed printers using System.Drawing.Printing.PrinterSettings.InstalledPrinters

Posted on 2006-05-22
4
Medium Priority
?
3,644 Views
Last Modified: 2008-01-09
Hi,

I'm using ASP.NET 2005 with VB.NET.  I’m trying to display all printers installed on my laptop using the drop down list control.  The following code does not display the installed printer on the server at "\\Beatles\Dell Photo AIO Printer 922"

        ddlPrinter.DataSource = System.Drawing.Printing.PrinterSettings.InstalledPrinters


Any Suggestions?
Thanks,
Denise

0
Comment
Question by:DeniseGoodheart
  • 2
  • 2
4 Comments
 
LVL 33

Expert Comment

by:raterus
ID: 16736364
Unless your laptop is the webserver, you aren't going to retrieve a list of client printers using that method.  In fact, there is no way to do that using asp.net.
0
 

Author Comment

by:DeniseGoodheart
ID: 16738697
Hi raterus,

My laptop is the webserver.  I thought it was some how possible because it displays the printer Microsoft Office Document Image Writer wtihin the drop down list control, but not the \\Beatles\Dell Photo AIO Printer 922.  When I print from my laptop, it uses \\Beatles\Dell Photo AIO Printer 922

Thanks,
Denise


0
 
LVL 33

Accepted Solution

by:
raterus earned 1500 total points
ID: 16741882
Probably because the printer isn't installed for the ASPNET or NETWORK SERVICE account.  Depending on the authentication model you've selected for your application, you may be able to add <identity impersonate="true" /> to web.config and see the printers your account would have on the computer.  You'd have to be using integrated windows authentication for this to make a difference.  This is all a longshot guess, since I've never had to write code to display available printers on the server.

0
 

Author Comment

by:DeniseGoodheart
ID: 16747715
Hi Raterus,

Thanks for your comment.  I'm working on a Web project that requires I use Crystal Reports .NET 2005.  I found out today that the reports need to be available for the Internet, and not just an Intranet application.  So finding available printer servers is no longer necessary.  So now I need to figure out how to make printing available for Internet users, so I'll post a new question.

Thanks,
Denise
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview
Suggested Courses
Course of the Month15 days, 18 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question