3
正在尝试在共享打印机上打印文档;我需要让我的0.But默认打印机配置为“的HP LaserJet P1505n”打印队列details.The下面的代码总是会从“Microsoft XPS文档”队列为数字作业=的获取共享打印机的打印队列详细信息
LocalPrintServer server = new LocalPrintServer()
PrintQueueCollection queueCollection = server.GetPrintQueues();
PrintQueue printQueue = null;
foreach (PrintQueue pq in queueCollection)
{
Logger.LogInfo("PrintQueue1", "Printer1 Queue Name " + pq.FullName);
printQueue = pq;
numberOfJobs = printQueue.NumberOfJobs;
Logger.LogInfo("numberOfJobs1"+ numberOfJobs);
}
如何获得打印从该特定共享打印机排队详细信息?我尝试也
PrintServer server = new PrintServer(@"\\192.168.100.168\HP LaserJet P1505n");
以下,但得到的错误为:
Win32 error: The filename, directory name, or volume label syntax is incorrect
我失去的是什么?
您必须使用打印服务器,而不是LocalPrintServer。并使用服务器名称,而不是打印机名称,而不是IP地址。并有足够的访问权限。询问你的局域网管理员来帮助你。 –