如何使用C#禁用高级打印功能(RawOnly)

时间:2015-07-07 09:23:19

标签: c# printing system.printing printqueue

我尝试使用C#禁用高级打印功能(RawOnly)。 我可以列出所有打印机:

foreach (string printer in PrinterSettings.InstalledPrinters)
{
    Console.WriteLine(printer);
}

我可以阅读RawOnly功能:

PrintQueueAttributes[] queueAttributes = { PrintQueueAttributes.RawOnly };
EnumeratedPrintQueueTypes[] enumerationFlags = { EnumeratedPrintQueueTypes.RawOnly };
LocalPrintServer printServer = new LocalPrintServer();
PrinterSettings settings = new PrinterSettings();
PrintQueueCollection printQueuesOnLocalServer = printServer.GetPrintQueues();
foreach (PrintQueue printer in printQueuesOnLocalServer)
{
     Console.WriteLine("\tThe printer " + printer.Name + "is Advanced Printing Features enabled" + printer.IsRawOnlyEnabled + "\n");
}
Console.WriteLine("Press enter to continue.");
Console.ReadLine();

但我不知道如何设置RawOnly功能。你能帮帮我吗?谢谢。

有关EnumeratedPrintQueueTypes https://msdn.microsoft.com/en-us/library/system.printing.enumeratedprintqueuetypes(v=vs.110).aspx

的其他信息

有关PrintQueueAttributes的其他信息 https://msdn.microsoft.com/en-us/library/system.printing.printqueueattributes(v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1

P.S。我不想使用Win32_Printer类,因为它存在一些问题。

0 个答案:

没有答案