首页 > 解决方案 > Windows App interacting with scanner

问题描述

I'm trying to write a windows app that interacts with a scanner. I got it to build and connect to the scanner and trigger it to actually scan. My problem is that after each page it scans it throws an exception and it isn't writing anything to disk. I've also tried to scan a preview and it doesn't write anything to the stream. Of course it's one of those exceptions that it's incredibly useful:

Unspecified error

Unspecified error

Yay!

Here's the stacktrace:

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at DeviceScannerThing.<GetDevices>d__0.MoveNext() in  [Redacted]

This is the line that the exception gets thrown on:

result = await myScanner.ScanFilesToFolderAsync(ImageScannerScanSource.Default, folder);

I should have full access to the folder it's using and it does trigger the scanner to scan. I've checked the event viewer and there isn't anything helpful there. I'm really at a loss at this point and could use any pointers anyone may have.

I'm trying to run this from a console app.

Thanks.

标签: c#windowsconsolescanning

解决方案


推荐阅读