System.Runtime.InteropServices.COMException (0x8000401A): Retrieving the COM class factory for compo...

这个问题困扰了我很久,在网上找了很多资料都没用,

最后找到解决方案:

运行dcomcnfg打开组件服务,

依次展开"组件服务"->"计算机"->"我的电脑"->"DCOM配置"

找到"Microsoft Excel应用程序"或"Microsoft Word应用程序",

右键打开属性对话框,点击"标识"选项卡,

点"下列用户",把管理员的用户密码正确填写进去...

点击"安全"选项卡,

依次把"启动和激活权限","访问权限","配置权限",都选择为自定义,

然后依次点击它们的编辑,把everyone添加进去,并加入所有的权限...

OK,解决此问题!

展开阅读全文

Jmail发邮件错误 Retrieving the COM class factory for component with CLSID

01-20

写了个很简单的用jamil发注册验证邮件的程序,本地调试通过,可以发,为什么传到服务器上就出错rnServer Error in '/web' Application.rn--------------------------------------------------------------------------------rnrnRetrieving the COM class factory for component with CLSID E5FF9F62-0E7C-4372-8AD5-DA7D2418070C failed due to the following error: 80040154. rnDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. rnrnException Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID E5FF9F62-0E7C-4372-8AD5-DA7D2418070C failed due to the following error: 80040154.rnrnSource Error: rnrnAn unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. rnrnStack Trace: rnrnrn[COMException (0x80040154): Retrieving the COM class factory for component with CLSID E5FF9F62-0E7C-4372-8AD5-DA7D2418070C failed due to the following error: 80040154.]rn beejoy.editor.Mail.sendEmail(String Receiver, String Subject, String Content) in e:\X.C\Documents\Visual Studio 2005\WebSites\beejoy\App_Code\UserModel.cs:373rn beejoy.editor.finish.SendValidateMail() in e:\X.C\Documents\Visual Studio 2005\WebSites\beejoy\register\finish.aspx.cs:74rn beejoy.editor.finish.Page_Load(Object sender, EventArgs e) in e:\X.C\Documents\Visual Studio 2005\WebSites\beejoy\register\finish.aspx.cs:46rn System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15rn System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34rn System.Web.UI.Control.OnLoad(EventArgs e) +99rn System.Web.UI.Control.LoadRecursive() +47rn System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061rnrn rnrnrn--------------------------------------------------------------------------------rnVersion Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 rnrn各位帮忙看看什么问题啊!!谢谢!!!! 论坛

System.Runtime.InteropServices.COMException

02-27

[code=C#]rn //捕获IE窗口rn private void webBrowser1_NewWindow(object sender, CancelEventArgs e)rn rn WriteLog("捕获默认IE窗口");rn timeIE.Enabled = true;rn timeIE.Start();rn rn private void timeIE_Tick(object sender, EventArgs e)rn rnrn ListenIE(); rn rn private void ListenIE()rn rn tryrn rn SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass(); rnrn mshtml.IHTMLDocument2 htmlDoc;rnrn String filename = null;rn String str = null;rn rn foreach (SHDocVw.InternetExplorer ie in shellWindows)rn rn filename = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();rn if (filename.Equals("iexplore"))rn rn //Console.WriteLine(ie.LocationURL);rn htmlDoc = ie.Document as mshtml.IHTMLDocument2;rn //System.Threading.Thread.Sleep(3000);rn IntPtr activeHwnd = GetForegroundWindow();rn //Console.WriteLine("activeHwnd====" + activeHwnd);rn WriteLog("--------------");rn if (htmlDoc != null)rn rn if (ie.HWND == activeHwnd.ToInt32()) rn rn ie.Refresh();rn rn tryrn rn str = htmlDoc.body.innerHTML;rnrn //Console.WriteLine("=========>" + str);rn if(str.Contains("HTTP 错误 404 - 文件或目录未找到"))rn rn timeIE.Enabled = false;rn timeIE.Stop();rn System.Threading.Thread.Sleep(3000);rn CloseIE();rn WriteLog("HTTP 错误 404");rn //CloseWindow(activeHwnd);rn //errorInforToUrl();rnrn rnrn rn catch(Exception e) //白屏异常rn rn //Console.WriteLine("e=============" + e.ToString());rn WriteLog("白屏异常=" + e.ToString());rn timeIE.Enabled = false;rn timeIE.Stop();rn System.Threading.Thread.Sleep(5000);rn CloseIE();rn //CloseWindow(activeHwnd);rn //sendErrorInfor("termid=" + termid + "&errmsg=" + e.ToString());rn //errorInforToUrl();rn rn rn rn rn rn catch(Exception e)rn rn WriteLog("SHDocVw异常=" + e.ToString());rn rn rnrn rn /// rn /// 关闭IE进程rn /// rn private void CloseIE()rn rn tryrn rn System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcesses();rnrn foreach (System.Diagnostics.Process myProcess in myProcesses)rn rn if (myProcess.ProcessName.ToUpper() == "IEXPLORE")rn rn myProcess.Kill();rn rn rn rn catch(Exception e)rn rn WriteLog("关闭IE异常=" + e.ToString());rn rnrn rn[/code]rn运行到这里(SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();)报异常:rnSHDocVw异常=System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID 9BA05972-F6A8-11CF-A442-00A0C90A8F39 failed due to the following error: 80040154.rn at IEBrowser.IEBrowserForm.ListenIE()rn 论坛

没有更多推荐了,返回首页