В этом разделе
VintaSoft TWAIN .NET SDK предоставляет диспетчер устройств WIA, который обеспечивает доступ к устройствам WIA.
Для работы с диспетчером устройств WIA необходимо создать экземпляр класса
WiaDeviceManager.
Вот пример, демонстрирующий, как открыть диспетчер устройств WIA и отобразить информацию обо всех доступных устройствах WIA:
/// <summary>
/// Opens WIA device manager and displays information about available WIA image scanners.
/// </summary>
void GetWiaDevicesInfo()
{
// create WIA device manager
using (Vintasoft.WiaImageScanning.WiaDeviceManager deviceManager = new Vintasoft.WiaImageScanning.WiaDeviceManager())
{
// open device manager
deviceManager.Open();
Vintasoft.WiaImageScanning.WiaDeviceCollection devices = deviceManager.Devices;
// for each WIA device
for (int i = 0; i < devices.Count; i++)
{
// output the device name
System.Console.WriteLine(string.Format("Device '{0}'", devices[i].Name));
}
}
}
''' <summary>
''' Opens WIA device manager and displays information about available WIA image scanners.
''' </summary>
Private Sub GetWiaDevicesInfo()
' create WIA device manager
Using deviceManager As New Vintasoft.WiaImageScanning.WiaDeviceManager()
' open device manager
deviceManager.Open()
' get count of WIA devices
Dim deviceCount As Integer = deviceManager.Devices.Count
If deviceCount = 0 Then
System.Console.WriteLine("Devices are not found.")
Return
End If
Dim devices As Vintasoft.WiaImageScanning.WiaDeviceCollection = deviceManager.Devices
' for each WIA device
For i As Integer = 0 To devices.Count - 1
' output the device name
System.Console.WriteLine(String.Format("Device '{0}'", devices(i).Name))
Next
End Using
End Sub