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.