如何获取打印机状态(缺纸,缺墨。。。)

lampson123 2009-08-31 08:55:34
我使用的是网络打印机,如何在C#下获取打印机状态(缺纸,缺墨。。。),谢谢。
...全文
4954 47 打赏 收藏 转发到动态 举报
写回复
用AI写文章
47 条回复
切换为时间正序
请发表友善的回复…
发表回复
白色的海 2012-10-29
  • 打赏
  • 举报
回复
学习了
liweibird 2011-12-01
  • 打赏
  • 举报
回复
发现缺少了几个方法的定义啊
Veiky_c 2011-10-10
  • 打赏
  • 举报
回复
mark一下!
aqaq2 2011-07-30
  • 打赏
  • 举报
回复
这个不能用,返回的值一直都是0,为什么呢?
[Quote=引用 13 楼 bmwsl 的回复:]
public static string GetPrinterStatus(string PrinterName)
{
int intValue = GetPrinterStatusInt(PrinterName);
string strRet = string.Empty;
switch (intValue)
{
case 0:
strRe……
[/Quote]
平凡的傲娇 2011-05-18
  • 打赏
  • 举报
回复
好好看看,目前正在纠结中,谢谢各位。
shinetan24 2010-09-21
  • 打赏
  • 举报
回复
[Quote=引用 34 楼 wartim 的回复:]

添加引用 System.Printing
C# code
bool x=System.Printing.LocalPrintServer.GetDefaultPrintQueue().IsTonerLow; // 是否缺墨

不知道能不能用,还有很多的状态Is判断
[/Quote]


简单而且强大!请注意必须添加引用 System.Printing
qq82557566 2010-09-16
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 bmwsl 的回复:]
public static string GetPrinterStatus(string PrinterName)
{
int intValue = GetPrinterStatusInt(PrinterName);
string strRet = string.Empty;
switch (intValue)
{
case 0:
……
[/Quote]

返回的状态一直都是0
pengchen515 2010-06-21
  • 打赏
  • 举报
回复
[Quote=引用 34 楼 wartim 的回复:]
添加引用 System.Printing

C# code
bool x=System.Printing.LocalPrintServer.GetDefaultPrintQueue().IsTonerLow; // 是否缺墨

不知道能不能用,还有很多的状态Is判断
[/Quote]


有这个System.Printing么?
wartim 2009-10-07
  • 打赏
  • 举报
回复
添加引用 System.Printing
bool x=System.Printing.LocalPrintServer.GetDefaultPrintQueue().IsTonerLow; // 是否缺墨      

不知道能不能用,还有很多的状态Is判断
sz_xd 2009-10-07
  • 打赏
  • 举报
回复
實用,幫頂!
grady.lu 2009-10-06
  • 打赏
  • 举报
回复
mark and study
a854468521 2009-10-06
  • 打赏
  • 举报
回复
帮顶+曾分。
only_lonely 2009-10-06
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 pcqpzq 的回复:]
用API罗

不过每种打印机的驱动都不一样,如果有通用接口好办,否则就麻烦了
[/Quote]
嗯,就是这样
ljb07976513524 2009-10-06
  • 打赏
  • 举报
回复
哎!一群牛人啊!
liyoubaidu 2009-10-05
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 bmwsl 的回复:]
可以实现
调用打印机api
[/Quote]
正解
csrwgs 2009-10-05
  • 打赏
  • 举报
回复
MARK,学习!
zjh222 2009-10-05
  • 打赏
  • 举报
回复
用C++就好控制多了
abc_aaa_012 2009-10-05
  • 打赏
  • 举报
回复
ding...
l8487 2009-10-04
  • 打赏
  • 举报
回复
很久以前遇到过,没有解决了,今天终于看见了。收藏。。。
lampson123 2009-10-04
  • 打赏
  • 举报
回复
强大啊。。。
加载更多回复(22)

110,537

社区成员

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

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

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