无法在网络打印机上获取打印队列 [英] Unable to get the print queues on a net work printer

查看:585
本文介绍了无法在网络打印机上获取打印队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在网络打印机上获取打印队列时,出现以下错误.

枚举PrintQueue对象时发生了异常. Win32错误:文件名,目录名称或卷标签语法不正确.

我尝试使用不同的网络打印机,但遇到相同的错误.

代码:

 

When I try to get the printqueue on a network printer I am getting follwoing error.

An exception occurred while enumerating PrintQueue objects. Win32 error: The filename, directory name, or volume label syntax is incorrect.

I have tried different network printers but getting the same error.

Code:

 

PrintServer printSvr = PrintServer @" \\ DC-PRINTSVR \ HP3100&; );

 

PrintServer printSvr = new PrintServer(@"\\DC-PRINTSVR\HP3100");

 

PrintQueueCollection printQues = printSvr.GetPrintQueues();

推荐答案

通常您需要在使用共享资源之前对远程计算机进行身份验证.这意味着您需要p-invoke Windows网络功能.
usually you need to authenticate the remote computer before using a shared resource. And that means you need p-invoke Windows Networking Functions.

这与IDE有何关系?一支笔不能自己写东西.如果您需要帮助,请尝试CLR论坛.
How is this related to the IDE? A pen can't write stuff by its own. If you need help in pinvoke, try the CLR forum.


这篇关于无法在网络打印机上获取打印队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆