共用方式為


PrintSystemJobInfo.JobIdentifier 屬性

定義

取得列印工作的識別碼。

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

屬性值

Int32,可識別列印工作。

範例

下列範例示範如何在診斷列印作業的問題時,使用這個屬性。

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

備註

使用哪一個編號系統取決於列印伺服器的操作系統,以及列印伺服器是計算機還是列印伺服器設備。 例如,Microsoft Windows XP 的作業系統會以這種方式決定編號:當列印伺服器開啟時,如果所有列印佇列都是空的,則任何用戶都會在伺服器上提交的第一個列印作業,並指派給任何佇列 2。 伺服器上每個後續作業都會指派一個大於該伺服器上上一個列印作業的數位。

列印作業的列印佇列不會影響其數目:如果作業依該順序傳送至 QueueA、QueueB 和 QueueA,則 QueueA 有作業 2 和 4,而 QueueB 有作業 3。

指派一個數字之後,即使其他作業完成列印或取消,或伺服器重新啟動,數字永遠不會變更。 如果伺服器重新啟動時已有一或多個佇列中的作業,則會將第一個新作業指派一個大於伺服器啟動時佇列中最高編號作業的數位。 不過,在重新啟動之前,列印伺服器不會重複使用數位。 即使列印前已取消最高編號的作業,下一個作業仍會取得較高的數位。

適用於