Click here to Skip to main content
15,911,039 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to scan all pages with one click as below: Pin
Richard MacCutchan19-Nov-19 3:40
mveRichard MacCutchan19-Nov-19 3:40 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 3:52
Member 1094325619-Nov-19 3:52 
GeneralRe: How to scan all pages with one click as below: Pin
Richard MacCutchan19-Nov-19 4:02
mveRichard MacCutchan19-Nov-19 4:02 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 4:08
Member 1094325619-Nov-19 4:08 
GeneralRe: How to scan all pages with one click as below: Pin
Richard MacCutchan19-Nov-19 4:13
mveRichard MacCutchan19-Nov-19 4:13 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 4:30
Member 1094325619-Nov-19 4:30 
GeneralRe: How to scan all pages with one click as below: Pin
Richard MacCutchan19-Nov-19 4:45
mveRichard MacCutchan19-Nov-19 4:45 
AnswerRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon19-Nov-19 2:02
mvePete O'Hanlon19-Nov-19 2:02 
According to the Windows Imaging Acquisition codes, that means the paper is empty. If you reach this point, it suggests that you have finished scanning. Something you need to consider; your while loop will never end until you hit an exception because you aren't setting it to false anywhere. Also, your logic looks very odd. You're evaluating the scanners each time through the while loop, and connecting again and again. You should move the for loop and the AvailableScanner.Connect outside the while loop; something like this perhaps:
C#
for (int i = 1; i <= deviceManager.DeviceInfos.Count; i++)
{
  if (deviceManager.DeviceInfos[i].Type != WiaDeviceType.ScannerDeviceType) // Skip device If it is not a scanner
  {
    continue;
  }
  AvailableScanner = deviceManager.DeviceInfos[i];
  break;
}
if (AvailableScanner == null)
{
  return;
}
var device = AvailableScanner.Connect();
while (continueRunning2)
{
  // Are you absolutely certain you want array index 1 here?
  // Remember that arrays start at 0, so this might be a cause of
  // issues
  var ScanerItem = device.Items[1];
  ...
}



modified 19-Nov-19 8:08am.

GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 2:23
Member 1094325619-Nov-19 2:23 
GeneralRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon19-Nov-19 2:37
mvePete O'Hanlon19-Nov-19 2:37 
GeneralRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon19-Nov-19 2:38
mvePete O'Hanlon19-Nov-19 2:38 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 2:50
Member 1094325619-Nov-19 2:50 
GeneralRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon19-Nov-19 22:40
mvePete O'Hanlon19-Nov-19 22:40 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325620-Nov-19 0:35
Member 1094325620-Nov-19 0:35 
GeneralRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon20-Nov-19 0:49
mvePete O'Hanlon20-Nov-19 0:49 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325620-Nov-19 4:17
Member 1094325620-Nov-19 4:17 
GeneralRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon20-Nov-19 5:15
mvePete O'Hanlon20-Nov-19 5:15 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 3:04
Member 1094325619-Nov-19 3:04 
QuestionInsert voice data down SQLServer Pin
Hoang Luc18-Nov-19 4:45
Hoang Luc18-Nov-19 4:45 
AnswerRe: Insert voice data down SQLServer Pin
OriginalGriff18-Nov-19 4:46
mveOriginalGriff18-Nov-19 4:46 
Questionadd code text to speech voices windows 7 ? Pin
Member 245846717-Nov-19 21:14
Member 245846717-Nov-19 21:14 
AnswerRe: add code text to speech voices windows 7 ? Pin
Pete O'Hanlon17-Nov-19 22:07
mvePete O'Hanlon17-Nov-19 22:07 
GeneralRe: add code text to speech voices windows 7 ? Pin
Member 245846720-Nov-19 15:45
Member 245846720-Nov-19 15:45 
GeneralRe: add code text to speech voices windows 7 ? Pin
Pete O'Hanlon20-Nov-19 21:47
mvePete O'Hanlon20-Nov-19 21:47 
GeneralRe: add code text to speech voices windows 7 ? Pin
Member 245846724-Nov-19 15:06
Member 245846724-Nov-19 15:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.