Get list of network printers silverlight

一曲冷凌霜 提交于 2019-12-02 05:24:33

问题


I want to get the list of network printers through silverlight. I have seen a few examples of using WMI, but they are not available in Silverlight, so, I was wondering if there are any alternatives to find network printers through silverlight or at least the installed printers...

There is also a question posted here


回答1:


In Silverlight 5, you can use EnumPrinters Win32 API call through PInvoke. The code is pretty long, so I put together a sample that shows how to enumerate the printers on the machine.

http://10rem.net/blog/2011/09/27/enumerating-printers-using-pinvoke-in-silverlight-5

With Silverlight 4, you're out of luck.




回答2:


Its my understanding that you cannot do this. You don't have the control over this, it is simply handed off for its built in support. This is the same reason why you can't specify a printer - it just doesn't allow this.



来源:https://stackoverflow.com/questions/7573672/get-list-of-network-printers-silverlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!