Printing with Windows Service, without dialogue, without user interaction

I would like to print from Windows Service in C # using Visual Studio 2010. So far, I have been partially successful using the code found here:

Print html document from windows service without print dialog

The current problem I am facing is two times that I discovered allowing the service to interact with the desktop:

1) When the URL is entered as an HTML location, it asks for credentials for that location (IIS network shared web server, which I DO NOT have the ability to change in any way, which asks for a username and password to access the information) .

2) After entering the credentials, the default printer ALWAYS uses the XPS printer, regardless of what I do for SetDefaultPrinter (two different ways I found for this). I found that this is because the printer I want to print is also a network printer, access to which is not possible to access the local system account (apparently). I have not found a solution to this problem.

I would like to get around both of these problems by entering the necessary credentials (this is a set of credentials for a network resource) and then printing to a network printer. In other desktop applications, I successfully print on each of these network printers, even if I do not have each installed.

Attempting to log in using my credentials instead of the local system account does not solve any problems. I am using Windows XP.

, , , , , , , Local System, , , Windows Server 2003 2008, , .

EDIT: , . , (, , , , ). , , , , . , , XPS, - .

+3
2

. , . , , , , . , , . , IIS Windows, , , , -.

+1

,

--- > --- >

, .

.

enter image description here

0

All Articles