我控制访问我的扫描仪并进行扫描,它在开发和localhost上运行良好但是当通过Intranet访问时,它在尝试创建对象时出错并且在使用getobject时出现同样的问题 错误是system.notsupportedexception [comAutomation_featureBlocked]
using (dynamic CommonDialog = AutomationFactory.CreateObject("WIA.CommonDialog"))
{
dynamic imageFile = CommonDialog.ShowAcquireImage(
(int)WiaDeviceType.ScannerDeviceType,
(int)WiaImageIntent.ColorIntent,
(int)WiaImageBias.MaximizeQuality,
FormatID.wiaFormatJPEG, false, true, false);
if (imageFile != null)
{
string filePath = string.Format(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)+"{0}.jpg", Guid.NewGuid());
// string filePath = string.Format("C:\\tempScan\\{0}.jpg", Guid.NewGuid());
imageFile.SaveFile(filePath);
FileInfo info = new FileInfo(filePath);
UploadFile(filePath, info.OpenRead());
// MessageBox.Show(string.Format("Saved {0}", filePath));
}
}