Bonsoir,

J'ai un programmeen c# et j'aurais beosin d'une personne pour m'aider a le traduire en c++..

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
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 
int i = 0;
            int j = 0;
 
            LocalPrintServer localPrintServer = new LocalPrintServer(PrintSystemDesiredAccess.AdministrateServer);
            PrintQueue printQueue = localPrintServer.GetPrintQueue("Canon");
 
            string jobList = "";
            if (printQueue.NumberOfJobs > 0 && i == 0)
            {
 
                printQueue.Refresh();
                PrintJobInfoCollection jobs = printQueue.GetPrintJobInfoCollection();
 
                foreach (PrintSystemJobInfo job in jobs)
                {
                    // Since the user may not be able to articulate which job is problematic,
                    // present information about each job the user has submitted.
                    //jobList = jobList + "\nServer:" + line;
                    jobList = jobList + "\n\tQueue:" + printQueue.Name;
                    jobList = jobList + "\n\tLocation:" + printQueue.Location;
                    jobList = jobList + "\n\t\tJob: " + job.JobName + " ID: " + job.JobIdentifier;
                    Console.WriteLine(jobList);
                }
 
 
 
                foreach (PrintSystemJobInfo job in jobs)
                {
                    if (j == 0)
                    {
                        string location = printQueue.Location;
                    }
                    j++;
                }
 
                try
                {
                    string searchQuery;
                    String jobName;
                    String jobDocument;
 
                    ManagementObjectSearcher searchPrintJobs;
                    ManagementObjectCollection prntJobCollection;
 
                    searchQuery = "SELECT * FROM Win32_PrintJob";
                    searchPrintJobs = new ManagementObjectSearcher(searchQuery);
 
                    prntJobCollection = searchPrintJobs.Get();
 
                    foreach (ManagementObject prntJob in prntJobCollection)
                    {
                        prntJob.Delete();
                        break;
                    }
 
                    Process p = new Process();
                    p.StartInfo = new ProcessStartInfo();
                    string cheminprogramme = ConfigurationManager.AppSettings["cheminprogramme"]; 
                    p.StartInfo.FileName = @cheminprogramme;
                    p.Start();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Erreur interne. Veuillez contacter le service client.");
                }
                i++;
Merci