I have used vs2010 and silverlight 5 to access scanner in web browser. It was work on windows 7(32 and 64bit) machine perfectly.
At same time i was not able to get either function to work on window XP(32 and 64bit) machine.. I found that XP could not read WIA. When i going to create object
like AutomationFactory.CreateObject("WIA.CommonDialog")), i got error as
"No object was found registered for specified ProgID".
My code is,
try
{
using (dynamic CommonDialog = AutomationFactory.CreateObject("WIA.CommonDialog"))
{
dynamic imageFile = CommonDialog.ShowAcquireImage();
if (imageFile != null)
{
if (!Directory.Exists("D:\\ScanImage"))
{
Directory.CreateDirectory("D:\\ScanImage");
}
string filePath = string.Format("D:\\ScanImage\\{0}.jpg", Guid.NewGuid());
imageFile.SaveFile(filePath);
}
}
}
Thanks in advance.