PrintSystemJobInfo.JobIdentifier Proprietà

Definizione

Ottiene il numero di identificazione del processo di stampa.

public:
 property int JobIdentifier { int get(); };
public int JobIdentifier { get; }
member this.JobIdentifier : int
Public ReadOnly Property JobIdentifier As Integer

Valore della proprietà

Oggetto Int32 che identifica il processo di stampa.

Esempio

Nell'esempio seguente viene illustrato come utilizzare questa proprietà durante la diagnosi di un problema con un processo di stampa.

for each (PrintQueue^ pq in myPrintQueues)
{
   pq->Refresh();
   PrintJobInfoCollection^ jobs = pq->GetPrintJobInfoCollection();
   for each (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;
      }
   }
}
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
For Each pq As PrintQueue In myPrintQueues
    pq.Refresh()
    Dim jobs As PrintJobInfoCollection = pq.GetPrintJobInfoCollection()
    For Each job As PrintSystemJobInfo 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 Then
            atLeastOne = True
            jobList = jobList & vbLf & "Server:" & line
            jobList = jobList & vbLf & vbTab & "Queue:" & pq.Name
            jobList = jobList & vbLf & vbTab & "Location:" & pq.Location
            jobList = jobList & vbLf & vbTab & vbTab & "Job: " & job.JobName & " ID: " & job.JobIdentifier
        End If
    Next job ' end for each print job

Next pq ' end for each print queue

Commenti

Quale sistema di numerazione viene utilizzato è determinato dal sistema operativo del server di stampa e dal fatto che il server di stampa sia un computer o un'appliance server di stampa. Ad esempio, il sistema operativo per Microsoft Windows XP determina la numerazione in questo modo: quando un server di stampa è attivato, se tutte le code di stampa sono vuote, il primo processo di stampa inviato sul server da qualsiasi utente e a qualsiasi coda viene assegnato il numero ID 2. A ogni processo successivo nel server viene assegnato un numero maggiore del processo di stampa precedente nel server.

La coda di stampa per il processo di stampa non ha alcun effetto sul numero: se i processi vengono inviati a QueueA, QueueB e QueueA, in tale ordine, QueueA ha processi 2 e 4 e QueueB ha il processo 3.

Dopo l'assegnazione di un numero a un processo, il numero non cambia mai, anche se altri processi terminano la stampa o vengono annullati o se il server viene riavviato. Se sono già presenti processi in una o più code al riavvio del server, al primo processo viene assegnato un numero maggiore del processo con il numero più alto presente nella coda all'avvio del server. Tuttavia, finché non viene riavviato, un server di stampa non riutilizza un numero. Anche se il processo con il numero più alto viene annullato prima della stampa, il processo successivo ottiene un numero maggiore.

Si applica a