DeviceInfo.Create 方法

DeviceInfo 对象的 Create 方法与 Windows 映像采集 (WIA) DeviceInfo 对象指定的设备建立连接,并返回一个代表设备的 Item 对象。

语法

retVal = DeviceInfo.Create()

参数

此方法没有任何参数。

返回值

类型: IWiaDispatchItem

此方法返回 Item 对象,该对象表示创建的设备。

备注

枚举 Devices 集合后,使用 Create 方法创建与 WIA 硬件设备的连接。 方法返回一个 Item 对象,该对象表示设备 (根项) 。

示例

以下示例演示如何使用 Create 方法。

<SCRIPT LANGUAGE="VBScript">
Dim objWia
Dim objDeviceInfoCollection
Dim objDeviceInfo
Dim objItem
 
Set objWIA = CreateObject("Wia.Script")
 
Set objDeviceInfoCollection = objWia.Devices
 
For Each objDeviceInfo In objDeviceInfoCollection
    Set objItem = objDeviceInfo.Create()
Next
</SCRIPT>

要求

要求
最低受支持的客户端
Windows 2000 专业版、Windows XP [仅限桌面应用]
最低受支持的服务器
Windows Server 2003 [仅限桌面应用]
DLL
Wiascr.dll (版本 4.90 或更高版本)