PrintSystemJobInfo.JobIdentifier Property

Definition

Gets the identification number for the print job.

C#
public int JobIdentifier { get; }

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.

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

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

Product Versions
.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