有人可以帮我找出我的代码破坏的原因吗? [英] Can someone help me figure out why my code is breaking?

查看:92
本文介绍了有人可以帮我找出我的代码破坏的原因吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经删除了这个问题.......................................... ...



我尝试了什么:



删除了问题。 ...................................

解决方案

< blockquote>为什么在循环中不使用 Property 时,为每个循环使用

  foreach (属性项 in  scannerDevice.Items [ 1 ]。属性)



Quote:

我只是不明白为什么它会给我这个,因为它会扫描所有文件,然后它就会抛出。

你不断检查是否有东西需要扫描所有的纸张而你想知道为什么当送料器是空的并且无需扫描时会出现异常?严重?

您是否希望您的代码能够神奇地停止扫描?



您要么处理异常,要么测试是否存在异常情况进料器中。

I have removed the question.............................................

What I have tried:

Removed question....................................

解决方案

Why use a for each loop if you don't use Property in the loop ?

foreach (Property item in scannerDevice.Items[1].Properties)


Quote:

I just don't understand why it is giving me that because it scans all the documents, and then it throws that.

You continuously scan all sheets of paper without checking if there is something to scan and you wonder why you get an exception when feeder is empty and nothing to scan ? Serious ?
Do you expect you code to stop scanning magically ?

Either you handle the exception or you test if there is something in the feeder.


这篇关于有人可以帮我找出我的代码破坏的原因吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆