What options are available in C#/.NET to get开发者_运维问答 the status of an installed printer? The only information we need is if the printer is on or off (we have a little indicator on the screen that says 'Printer ready' or 'Printer offline').
Our application is a small client running on an embedded PC. We've found that the WMI Windows process is running out of memory. Watching it on my development PC there appears to be a memory leak as the amount of memory it uses slowly creeps up. On an embedded device with limited memory this is unacceptable and we're finding after a couple of hours the application crashes.
I would try to resolve the memory leak, but if you cant find it, you could always use PInvoke
calls (specifically GetPrinterData
). See an example here (Note: There are also WMI posts that could help you compare what you have and see if you can find the memory leak)
精彩评论