InsufficentPrinterAccessRightsException

May 20, 2010 at 7:49 AM

hi

i musst set all local printer set the KeepPrintedDocuments = True

i do this so

i am logged in with administrator rights

 

 

 Dim pserver As New PrintServer
            For Each PrinterInfo As PrinterInformation In pserver.Printers    

                           If PrinterInfo.CanLoggedInUserAdministerPrinter() Then          

         PrinterInfo.KeepPrintedDocuments = True        

       End If 

    Next

 

i became this exeption

"PrinterQueueWatch.PrinterMonitoringExceptions.InsufficentPrinterAccessRightsException" wurde aufgefangen.  Message=""  Source="PrinterQueueWatch"  StackTrace:       bei PrinterQueueWatch.PrinterInformation.SavePrinterInfo(PrinterInfoLevels Level, Boolean ModifySecurityDescriptor)    bei PrinterQueueWatch.PrinterInformation.set_KeepPrintedDocuments(Boolean value)    bei SysmonMGTConsole.Module1.SetFileSpooling(Boolean spool) in E:\Sysmon.net\Code2008\SysmonMGT\SysmonMGTConsole\SysmonMGTConsole\Module1.vb:Zeile 3360.  InnerException: System.AccessViolationException       Message="Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist."       Source="PrinterQueueWatch"       StackTrace:            bei PrinterQueueWatch.SpoolerApi.SetPrinter(IntPtr hPrinter, PrinterInfoLevels Level, PRINTER_INFO_2 pPrinter, PrinterControlCommands Command)    bei PrinterQueueWatch.PrinterInformation.SavePrinterInfo(PrinterInfoLevels Level, Boolean ModifySecurityDescriptor)       InnerException: 

 

 

can sombody help me please