获取silverlight网络打印机列表
我想通过silverlight获取网络打印机的列表。我见过一些使用WMI的例子,但它们在Silverlight中不可用,所以,我想知道是否有任何替代方法可以通过silverlight查找网络打印机或至少是已安装的打印机...
还有一个问题< a href="https://stackoverflow.com/questions/6667253/getting-a-list-of-local-printers-silverlight-4">此处
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在Silverlight 5中,您可以通过PInvoke使用EnumPrinters Win32 API调用。代码相当长,因此我整理了一个示例,展示如何枚举计算机上的打印机。
http://10rem.net/blog /2011/09/27/enumerate-printers-using-pinvoke-in-silverlight-5
对于 Silverlight 4,您就不走运了。
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.
我的理解是你不能这样做。您无法控制它,它只是由其内置支持移交。这与您无法指定打印机的原因相同 - 它只是不允许这样做。
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.