C#怎么实现监控一台电脑上的打印任务 求代码

wo_sweet 2011-08-19 04:32:21
你机子上装了两台打印机
打印的时候
按文件类型和大小判断
让系统选择不同的打印机打印...
...全文
351 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
oneatree 2011-08-20
  • 打赏
  • 举报
回复
mark
LMAOhuaNL 2011-08-19
  • 打赏
  • 举报
回复
获取打印服务器承载的打印队列的集合。

命名空间: System.Printing
程序集: System.Printing(在 System.Printing.dll 中)

语法
Visual Basic(声明)
Public Function GetPrintQueues As PrintQueueCollection

Visual Basic(用法)
Dim instance As PrintServer
Dim returnValue As PrintQueueCollection

returnValue = instance.GetPrintQueues()

C#
public PrintQueueCollection GetPrintQueues()

Visual C++
public:
PrintQueueCollection^ GetPrintQueues()

J#
public PrintQueueCollection GetPrintQueues()

JScript
public function GetPrintQueues() : PrintQueueCollection


返回值
类型:System.Printing..::.PrintQueueCollection

打印服务器上的打印队列的 PrintQueueCollection。

示例
下面的示例演示如何使用此方法列出 PrintServer 承载的打印队列。

C# 复制代码
// Create a PrintServer
// "theServer" must be a print server to which the user has full print access.
PrintServer myPrintServer = new PrintServer(@"\\theServer");

// List the print server's queues
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
String printQueueNames = "My Print Queues:\n\n";
foreach (PrintQueue pq in myPrintQueues)
{
printQueueNames += "\t" + pq.Name + "\n";
}
Console.WriteLine(printQueueNames);
Console.WriteLine("\nPress Return to continue.");
Console.ReadLine();

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧