I want to access some site , say gmail or twitter from my application. The application should fill my username and password and submit the form and post some updates from the application itself. Here is some code . Help would be appreciated
--------------------------------------------------------------------------
at line -
mshtml.HTMLDocu mentClass dclass = (mshtml.HTMLDoc umentClass)iexp .Document;
i am receiving an error - "Error HRESULT E_FAIL has been returned from a call to a COM component."
Code:
protected void Button1_Click(object sender, EventArgs e)
{
Object obj = null;
Object URL = "www.gmail.com";
InternetExplorer iexp = new InternetExplorer();
iexp .Visible = true;
iexp .Navigate2(ref URL, ref obj , ref obj , ref obj , ref obj );
//iexp .Navigate("http://www.gmail.com", ref obj , ref obj , ref obj , ref obj );
while (iexp .Busy)
{
System.Threading.Thread.Sleep(50);
}
mshtml.HTMLDocumentClass dclass = (mshtml.HTMLDocumentClass)iexp .Document;
mshtml.HTMLInputElementClass eclass= (mshtml.HTMLInputElementClass)dclass.all.item("email", null);
eclass.value = "username";
eclass= (mshtml.HTMLInputElementClass)dclass.all.item("Passwd", null);
eclass.value = "password";
eclass= (mshtml.HTMLInputElementClass)dclass.all.item("signIn", null);
eclass.click;
}
at line -
mshtml.HTMLDocu mentClass dclass = (mshtml.HTMLDoc umentClass)iexp .Document;
i am receiving an error - "Error HRESULT E_FAIL has been returned from a call to a COM component."
Comment