PrintQueue.GetJob(Int32) Método

Definición

Obtiene el trabajo de impresión con el número de id. especificado.

C#
public System.Printing.PrintSystemJobInfo GetJob(int jobId);

Parámetros

jobId
Int32

Número del trabajo en la cola.

Devoluciones

PrintSystemJobInfo que especifica las propiedades del trabajo y su estado.

Ejemplos

En el ejemplo siguiente se muestra cómo usar este método al diagnosticar un problema con un trabajo de impresión.

C#
foreach (PrintQueue pq in myPrintQueues)
{
    pq.Refresh();
    PrintJobInfoCollection jobs = pq.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.
        if (job.Submitter == userName)
        {
            atLeastOne = true;
            jobList = jobList + "\nServer:" + line;
            jobList = jobList + "\n\tQueue:" + pq.Name;
            jobList = jobList + "\n\tLocation:" + pq.Location;
            jobList = jobList + "\n\t\tJob: " + job.JobName + " ID: " + job.JobIdentifier;
        }
    }// end for each print job    
}// end for each print queue

Comentarios

También puede usar el PrintSystemJobInfo.Get método para el mismo propósito.

Se aplica a

Producto Versiones
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Consulte también