Bonjour,
J'en est marre !
Pourquoi sur ce purge() j'ai une erreur de droit alors que je lance mon application en tant qu'admin ?
Merci encore..
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 LocalPrintServer localPrintServer = new LocalPrintServer(PrintSystemDesiredAccess.None); PrintQueue printQueue = localPrintServer.GetPrintQueue("Canon"); if (printQueue.NumberOfJobs > 0) { try { printQueue.Purge(); Application.Restart(); } catch (Exception ex) { MessageBox.Show("Erreur : " + ex); } }
Partager