我可以使用WMI管理WSD的设备(特别是打印机)?特别是、可以使用、打印机、设备

2023-09-05 01:08:00 作者:国家煮媳

我使用WMI用C#枚举和修改打印机我的电脑上。

I am using WMI with C# to enumerate and modify the printers on my computer.

我运行Windows 7,一切工作正常,当我试图修改已安装的经典的打印机。所谓经典,我的意思是打印机只使用一个基本的TCP / IP端口。我可以将其重命名,使用记录的WMI功能在这里将其设置为默认打印机,等:的http://msdn.microsoft.com/en-us/library/windows/desktop/aa394363(v=vs.85).aspx.

I'm running Windows 7, and everything is working fine when I try to modify printers that are installed "classically". By "classically", I mean that the printer is just using a basic TCP/IP Port. I can rename it, set it as the default printer, etc. using the documented WMI functions here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa394363(v=vs.85).aspx.

不过,默认情况下,Windows正在(对设备的Web服务)的打印机安装我的打印机作为WSD。当发生这种情况时,打印机使用WSD端口,我似乎无法使用WMI触摸。

However, by default Windows is installing my printer as a WSD (Web Services on Devices) printer. When this happens, the printer uses a WSD Port, which I can't seem to touch using WMI.

在下面的截图中,你可以看到,我的打印机使用WSD端口。下面该端口是标准的TCP / IP端口,当没有WSD安装我的打印机使用。

In the screenshot below, you can see that my printer is using a "WSD Port". Below that port is the standard TCP/IP Port that my printer uses when installed without WSD.

随我的打印机软件安装使用标准的TCP / IP端口的打印机。然而,当我手动安装我的打印机,Windows选择WSD端口。

The software that came with my printer installs the printer using a standard TCP/IP port. However, when I manually install my printer, Windows chooses the WSD port.

WMI似乎有WSD的设备没有定义。有谁知道,如果这是真的吗?

WMI seems to have no definition for WSD enabled devices. Does anyone know if this is true?

推荐答案

这应该是您的WMI,在你的设备和打印机显示的所有打印机都列在WMI。给你举个例子,我有一个类似的情况下,我必须使用WSD PORTNAME一台打印机,我们可以从code管理。

It should be in your WMI, all printers shown in your Devices and Printers are listed on WMI. To give you an example I have a similar situation where I have a printer using the WSD portname and we can manage it from code.