I am using WIA to connect to a scanner. I enumerate the device Infos and then try connecting to the device. I keep getting the exception.
Exception from HRESULT: 0x80070021
WIA.DeviceManager manager = new WIA.DeviceManager();
WIA.Device device = null;
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
// connect to scanner
device = info.Connect();
break;
}
Exception message is: The process cannot access the file because another process has locked a portion of the file. (Exception from HRESULT: 0x80070021)
My Scanner machine not connected. I got error "access the file because another process has locked a portion of the file. (Exception from HRESULT: 0x80070021)"
But Individually Scan working fine. when i try to connect with coding i get error.
User contributions licensed under CC BY-SA 3.0