This 335th time this question was asked, I did not find the answer. I am trying to send raw data directly to the printer via the WinSpool api from an ASP.net C # application.
My code is just a copy here .
Error here
if( OpenPrinter( szPrinterName.Normalize(), out hPrinter, IntPtr.Zero ) )
It works fine for a local printer, but for a shared network printer, the result OpenPrinter( GetLastErroractually the result ) is always 5 - Access Denied.
I tried
- different values for
PRINTER_DEFAULTSwith different combinationsDesiredAccess - grant the user administrator rights.
- set up a printer like this
I should note that I just want to print, not change the printer configuration or something that requires administrator rights.
" " . . API?
: , , Windows . -?
2: , - ( : DMZ), ( )
3: . (, \\host_pc\C$), , . " " , "" , .