打印机
文章平均质量分 78
伏龙坤
苦逼程序猿
展开
-
C# 关于打印机的监视
由于工作原因,需要监视打印机状态(windows 上spooler),然后做取得一些关于打印机操作。 在VC++平台,问题很好解决,也有很好的平台解决方案,但是苦于要做成Windows Service和大量平台多线程处理(线程池),还有Tcp通信,xml配置等等,在C++上实现,我的编码效率低,用C#利用微软成熟的.net 4.0平台,时装比较快,我就采用了C# 来实现,但是问题来了,大量的sp...原创 2018-08-30 22:59:46 · 7282 阅读 · 2 评论 -
C#监视打印机(接上篇)
关于上一篇,由于有了基本函数,也有了大神给的几乎直接可以用的源码,视乎问题就解决了。 但是问题远远没有那么简单,在测试x64时候出现了比较棘手的问题。 前文我们用到一些有价值的系统函数 在Win32 上我们用 微软的例子用到WaitForSingleObject(hChange, INFINITE) 我们在C# 。.net4.0平台用一个回调函数来完成 _changeHandle ...原创 2018-08-31 23:55:25 · 5057 阅读 · 3 评论 -
转发(blogger Ben)PRINTER_NOTIFY_INFO
Unmanaged Structures, Padding and C#, Part 1 One of the nice things about the Spooler API is the ability to be able to use the API to receive notification events when something happens on a printer s...转载 2018-09-01 00:00:27 · 276 阅读 · 0 评论 -
转发2(blogger Ben)PRINTER_NOTIFY_INFO
Unmanaged Structures, Padding and C#, Part 2 Continuing on from my previous post, we find that we have problems when we try to use our C# structure on a 64bit environment due to the way structures ar...转载 2018-09-01 00:01:39 · 292 阅读 · 0 评论