Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i created a project and hosted in IIS. now i want to get all printer (including network printers) connected to the system to check the printers are online or offline . i made the code using WMI, this code working fine in windows app and web app which is not hosted.

problem is is that code will not give any network printer once it is hosted

any help.. Thanks in advance.
Posted
Updated 26-Apr-11 20:20pm
v3
Comments
Sandeep Mewara 27-Apr-11 1:45am    
Not clear. You need to be more elaborative in order to get something.
anvas kuttan 27-Apr-11 1:57am    
sandeep i made the question clear

1 solution

The problem is the user you are running under probably does not have access to the network.
You need to allow your user to run under elevated permissions (or try and use impersonation).
See msdn to have a look at elevating permissions or impersonation.
 
Share this answer
 
v2
Comments
anvas kuttan 30-Apr-11 0:20am    
but it wont give me an access denied error it shows only printer installed in my system but i have to get all the printers (network printers)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900