c# - 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.
解决方案
推荐阅读
- angular - 如何检查事件目标是否在一个元素内?
- erlang - 查询MUC房间归档消息
- bash - 多个 .bashrc 配置文件
- php - Image Magick - 如何从图像创建 pdf 文档而不是让它看起来像图像 - PHP?
- php - wordpress 中的用户过滤器
- php - PHP突然插入空白值
- r - ggplot2:叠加两层时出错
- sql - 如果日期是周末或银行假日,则调整日期
- facebook-graph-api - Facebook Graph Api 为 Ad Insights API 返回空数据
- spring-boot - 如何使用 keycloak 在 Spring Security 中同时保护 Web 浏览器请求和 Restful 请求