閱讀英文版本

分享方式:


PrintJobStatus 列舉

定義

指定列印佇列中列印工作的目前狀態。

此列舉支援其成員值的位元組合。

C#
[System.Flags]
public enum PrintJobStatus
繼承
PrintJobStatus
屬性

欄位

名稱 Description
Blocked 512

可能是佇列中先前列印工作的錯誤狀況封鎖了這個列印工作。

Completed 4096

列印工作已經完成,包括任何的列印後處理。

Deleted 256

列印工作通常會在列印之後從佇列中刪除。

Deleting 4

正在刪除列印工作。

Error 2

列印工作處於錯誤狀態。

None 0

列印工作沒有指定的狀態。

Offline 32

印表機為離線。

PaperOut 64

印表機上所需大小的紙張已用完。

Paused 1

列印工作已暫停。

Printed 128

列印工作已列印。

Printing 16

列印工作現在正在列印中。

Restarted 2048

列印工作遭到封鎖,但已重新啟動。

Retained 8192

列印工作在列印後仍保留在列印佇列中。

Spooling 8

列印工作正在多工緩衝處理中。

UserIntervention 1024

印表機需要使用者動作才能修正錯誤狀況。

範例

下列範例示範如何在診斷列印作業的問題時使用此列舉。

C#
// Check for possible trouble states of a print job using the flags of the JobStatus property
internal static void SpotTroubleUsingJobAttributes(PrintSystemJobInfo theJob)
{
    if ((theJob.JobStatus & PrintJobStatus.Blocked) == PrintJobStatus.Blocked)
    {
        Console.WriteLine("The job is blocked.");
    }
    if (((theJob.JobStatus & PrintJobStatus.Completed) == PrintJobStatus.Completed)
        || 
        ((theJob.JobStatus & PrintJobStatus.Printed) == PrintJobStatus.Printed))
    {
        Console.WriteLine("The job has finished. Have user recheck all output bins and be sure the correct printer is being checked.");
    }
    if (((theJob.JobStatus & PrintJobStatus.Deleted) == PrintJobStatus.Deleted)
        || 
        ((theJob.JobStatus & PrintJobStatus.Deleting) == PrintJobStatus.Deleting))
    {
        Console.WriteLine("The user or someone with administration rights to the queue has deleted the job. It must be resubmitted.");
    }
    if ((theJob.JobStatus & PrintJobStatus.Error) == PrintJobStatus.Error)
    {
        Console.WriteLine("The job has errored.");
    }
    if ((theJob.JobStatus & PrintJobStatus.Offline) == PrintJobStatus.Offline)
    {
        Console.WriteLine("The printer is offline. Have user put it online with printer front panel.");
    }
    if ((theJob.JobStatus & PrintJobStatus.PaperOut) == PrintJobStatus.PaperOut)
    {
        Console.WriteLine("The printer is out of paper of the size required by the job. Have user add paper.");
    }

    if (((theJob.JobStatus & PrintJobStatus.Paused) == PrintJobStatus.Paused)
        || 
        ((theJob.HostingPrintQueue.QueueStatus & PrintQueueStatus.Paused) == PrintQueueStatus.Paused))
    {
        HandlePausedJob(theJob);
        //HandlePausedJob is defined in the complete example.
    }

    if ((theJob.JobStatus & PrintJobStatus.Printing) == PrintJobStatus.Printing)
    {
        Console.WriteLine("The job is printing now.");
    }
    if ((theJob.JobStatus & PrintJobStatus.Spooling) == PrintJobStatus.Spooling)
    {
        Console.WriteLine("The job is spooling now.");
    }
    if ((theJob.JobStatus & PrintJobStatus.UserIntervention) == PrintJobStatus.UserIntervention)
    {
        Console.WriteLine("The printer needs human intervention.");
    }
}//end SpotTroubleUsingJobAttributes

備註

這個列舉主要用於做為 屬性的值 JobStatus

適用於

產品 版本
.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

另請參閱