如何知道用户是否具有C#中网络打印机的访问权限(如打印,管理文档) [英] How to know if user has access rights(like print, manage documents) on network printer in C#

查看:127
本文介绍了如何知道用户是否具有C#中网络打印机的访问权限(如打印,管理文档)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道用户是否具有网络打印机的访问权限。我的方案是我使用system.printing库来获取打印机信息,但是当我尝试创建对象Printqueue时,以下语句从未完成其执行。这里是它的示例代码



I want to know if the user has access rights on network printer or not. My scenario is i am using system.printing library to get the printer information, but when i try to create object Printqueue then the following statement never completed its execution. here is the sample code for it

PrintServer printServer = new PrintServer(@"\\" + printServerName);
PrintQueue printQueue = printServer.GetPrintQueue(printerName);



如果网络打印机没有用户权限,则第二个语句永远不会完成执行。所以在这之前我想知道是否可以检查打印机的权限。请让我知道任何人都面临这个问题,并有任何解决方案。


Second statement never completes its execution in case if network printer has no rights to user. So before doing this i want to know if it is possible to check the rights on the printer. Please let me know any one has face this issue and has any solution for this.

推荐答案

这篇关于如何知道用户是否具有C#中网络打印机的访问权限(如打印,管理文档)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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