我的WIA Device Manager
semms始终有0 DeviceInfo
个条目。
这是我的代码:
DeviceManager m = new DeviceManager();
Console.WriteLine(m.DriveInfos.Count); // Always is 0 (Problem)
// Process Devices
for (int i = 1; (i <= m.DeviceInfos.Count); i++) // Assuming multiple scanners
{
try
{
if (m.DeviceInfos[i].Type == WiaDeviceType.ScannerDeviceType)
{
DeviceInfo di = m.DeviceInfos[i];
string n = di.Properties["Name"].get_Value().ToString();
Console.WriteLine("Scanner found: "+n);
scanners.Add(di); //Add to list for later use
}
} catch { }
}
是否有WIA的替代方案或是否有解决该问题的方法?