帮忙看下这段代码检测打印机缺纸信息的

未页 2012-10-29 02:21:49
private void isPapeout()
{
PrintServer myPrintServer = new PrintServer();
PrintQueue pringQueue;
try
{
pringQueue = myPrintServer.GetPrintQueue(printDocument1.PrinterSettings.PrinterName);
foreach (PrintSystemJobInfo job in pringQueue.GetPrintJobInfoCollection())
{
if (job.IsPaperOut==true)
{
MessageBox.Show("缺纸!");
}
else { MessageBox.Show("有纸!"); }
}
}
catch { MessageBox.Show("错误!"); }

}
为什么总是返回有纸呢。
...全文
74 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xggllc 2012-10-29
  • 打赏
  • 举报
回复
我刚开始学C# 表示还看不明白 ,帮顶一下
未页 2012-10-29
  • 打赏
  • 举报
回复
然后那个QueueStatus是none。。。

110,533

社区成员

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

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

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