Bewerken

Delen via


PrintSystemJobInfo.JobIdentifier Property

Definition

Gets the identification number for the print job.

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

Property Value

An Int32 that identifies the print job.

Examples

The following example shows how to use this property when diagnosing a problem with a print job.

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

Remarks

Which numbering system is used is determined by the operating system of the print server and whether the print server is a computer or a print server appliance. For example, the operating system for Microsoft Windows XP determines the numbering in this way: when a print server is turned on, if all its print queues are empty, the first print job submitted on the server by any user and to any queue is assigned ID number 2. Each subsequent job on the server is assigned a number that is one greater than the previous print job on that server.

The print queue for the print job has no effect on its number: if jobs are sent to QueueA, QueueB, and QueueA, in that order, then QueueA has jobs 2 and 4, and QueueB has job 3.

After a job is assigned a number, the number never changes, even if other jobs finish printing or are canceled, or if the server is restarted. If there are already jobs in one or more queues when the server is restarted, the first new job is assigned a number that is one greater than the highest numbered job that was in the queue when the server started. However, until it restarts, a print server does not reuse a number. Even if the highest numbered job is canceled before it is printed, the next job gets a number that is one higher.

Applies to