I am going with new concept Autologin in any website i did following code
public void GoToAutoLoin(string ProductLoginURL, string UserNameTagID, string PasswordTagID, string SignInTagID, string UserName, string Passowrd)
{
object o = null;
ie = new SHDocVw.InternetExplorer();
IWebBrowserApp wb = (IWebBrowserApp)ie;
wb.Visible = true;
//Do anything else with the window here that you wish
wb.Navigate(ProductLoginURL, ref o, ref o, ref o, ref o);
while (ie.Busy)
{
System.Threading.Thread.Sleep(500);
}
mshtml.DispHTMLDocument doc = ie.Document as mshtml.DispHTMLDocument;
doc.getElementById(UserNameTagID).setAttribute("value", UserName);
doc.getElementById(PasswordTagID).setAttribute("value", Passowrd);
doc.getElementById(SignInTagID).click();
//ie.Quit();
}
application goes fine when i run on development machine. but when i deployed on IIS 7.5 it gives following Error
i search a lot and found that it is related with DCOM permission rights, i gone through DCOM config editor
Control panel=>Administrative Tools=>component services=>console root=> computer=>mycomputer=>DcomConfig
now which DCOM Object i give permission to SHDocVw.InternetExplorer please guide me OR if you know any successfull solution
then please reply on it thanks in advanced
Server Error in '/' Application.
Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
Description:
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.
Exception Details: System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED)).
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and
the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated
request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
Line 15: {
Line 16: object o = null;
Line 17: ie = new SHDocVw.InternetExplorer(); Line 18: IWebBrowserApp wb = (IWebBrowserApp)ie;
Line 19: wb.Visible = true;
dhirajgautam...
0 Points
1 Post
Access Denied SHDocVw.InternetExplorer COM Object
Mar 30, 2012 12:56 PM|LINK
Hi Experts,
I am going with new concept Autologin in any website i did following code
public void GoToAutoLoin(string ProductLoginURL, string UserNameTagID, string PasswordTagID, string SignInTagID, string UserName, string Passowrd)
{
object o = null;
ie = new SHDocVw.InternetExplorer();
IWebBrowserApp wb = (IWebBrowserApp)ie;
wb.Visible = true;
//Do anything else with the window here that you wish
wb.Navigate(ProductLoginURL, ref o, ref o, ref o, ref o);
while (ie.Busy)
{
System.Threading.Thread.Sleep(500);
}
mshtml.DispHTMLDocument doc = ie.Document as mshtml.DispHTMLDocument;
doc.getElementById(UserNameTagID).setAttribute("value", UserName);
doc.getElementById(PasswordTagID).setAttribute("value", Passowrd);
doc.getElementById(SignInTagID).click();
//ie.Quit();
}
application goes fine when i run on development machine. but when i deployed on IIS 7.5 it gives following Error
i search a lot and found that it is related with DCOM permission rights, i gone through DCOM config editor
Control panel=>Administrative Tools=>component services=>console root=> computer=>mycomputer=>DcomConfig
now which DCOM Object i give permission to SHDocVw.InternetExplorer please guide me OR if you know any successfull solution
then please reply on it thanks in advanced
Server Error in '/' Application.
Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
Description: 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.
Exception Details: System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
Line 15: { Line 16: object o = null; Line 17: ie = new SHDocVw.InternetExplorer(); Line 18: IWebBrowserApp wb = (IWebBrowserApp)ie; Line 19: wb.Visible = true;Source File: D:\Project\Test Source\CentralLogin_Redirect\WebAutoLogin\WebAutoLogin\BAL\Utls.cs Line: 17
Stack Trace:
[UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).] WebAutoLogin.Utils.GoToAutoLoin(String ProductLoginURL, String UserNameTagID, String PasswordTagID, String SignInTagID, String UserName, String Passowrd) in D:\Project\Test Source\CentralLogin_Redirect\WebAutoLogin\WebAutoLogin\BAL\Utls.cs:17 WebAutoLogin.VIEWS.Main.dListApps_ItemCommand(Object source, DataListCommandEventArgs e) in D:\Project\Test Source\CentralLogin_Redirect\WebAutoLogin\WebAutoLogin\VIEWS\Main.Master.cs:111 System.Web.UI.WebControls.DataList.OnItemCommand(DataListCommandEventArgs e) +115 System.Web.UI.WebControls.DataList.OnBubbleEvent(Object source, EventArgs e) +79 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.DataListItem.OnBubbleEvent(Object source, EventArgs e) +121 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +125 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +177 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
<div align="center"></div>
Thanks & Regards,
Dhiraj V. Gautame
Research Engineer
SonicMan
Participant
1472 Points
228 Posts
Re: Access Denied SHDocVw.InternetExplorer COM Object
Apr 02, 2012 07:11 AM|LINK
Hi
May be it's a permission problem.
Please change your permissions like this:
http://learn.iis.net/page.aspx/140/understanding-built-in-user-and-group-accounts-in-iis/
And you can go to IIS forum for better answer.