473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Auto fill and submit another site

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


Expand|Select|Wrap|Line Numbers
  1. protected void Button1_Click(object sender, EventArgs e)
  2. {
  3. Object obj = null;
  4. Object URL = "www.gmail.com";
  5. InternetExplorer iexp = new InternetExplorer();
  6. iexp .Visible = true;
  7. iexp .Navigate2(ref URL, ref obj , ref obj , ref obj , ref obj );
  8. //iexp .Navigate("http://www.gmail.com", ref obj , ref obj , ref obj , ref obj );
  9.  
  10. while (iexp .Busy)
  11. {
  12. System.Threading.Thread.Sleep(50);
  13. }
  14.  
  15. mshtml.HTMLDocumentClass dclass = (mshtml.HTMLDocumentClass)iexp .Document;
  16.  
  17.  
  18. mshtml.HTMLInputElementClass eclass= (mshtml.HTMLInputElementClass)dclass.all.item("email", null);
  19. eclass.value = "username";
  20.  
  21.  
  22. eclass= (mshtml.HTMLInputElementClass)dclass.all.item("Passwd", null);
  23. eclass.value = "password";
  24.  
  25. eclass= (mshtml.HTMLInputElementClass)dclass.all.item("signIn", null);
  26. eclass.click; 
  27. }
--------------------------------------------------------------------------

at line -
mshtml.HTMLDocumentClass dclass = (mshtml.HTMLDocumentClass)iexp .Document;

i am receiving an error - "Error HRESULT E_FAIL has been returned from a call to a COM component."
Feb 22 '10 #1
3 2776
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Feb 22 '10 #2
I got it .... next time i'll do it with code tags. But can anyone help me out with teh question i have posted ??
Feb 25 '10 #3
semomaniz
210 Expert 100+
I believe the error that you are referring to is related to permission. Check your IIS policy
Feb 25 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Barry Margolin | last post by:
Can I do the following with Javascript? My state has a web site that can be used for online filing for unemployment benefits. Every week I have to go to the site and fill in a form, checking...
1
by: Bill Menees | last post by:
VS.NET 2003 defaults the "Debugger Type" property to "Auto" for Visual C++ projects. Unfortunately, the "Auto" type isn't very smart. "Auto" bases the debugger type on the launched EXE's type,...
2
by: Rick Strahl [MVP] | last post by:
Run into an interesting problem today with a client of mine: They have an ASP.Net form that they want to drive through a client side HTTP interface. I know a Web Service would be a better way to...
4
by: dschruth | last post by:
Hello. Can anybody solve this problem? I am using a server-side language (PERL) to *try* to POST data to a HTTPS login script that doesn't have a standard "submit" button. The form appears...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
0
by: KelHemp | last post by:
Greetings, I've been using this site for lots of access help in the past, and it's very helpful! I have a new complexity for you all. Reworking a form to record 70-80 years of oil production on...
0
by: sandykumar | last post by:
Hi There is a site (suppose www.abc.com) which deals with the travel and hotel booking. it have the search form that displays the results according to the user requirements. now we have to...
0
by: Boki | last post by:
Hi All, I am creating a program that performs "auto fill in" and "auto submit" functions. I will feed the webbrowser the target URL, however, I don't know how to auto fill in text and submit....
12
by: badvoc | last post by:
Hi, I have had some good fortune on this site so I am back and I must iterate I am a beginer. I am having some problems getting to grips with the right technique to manage variables and...
3
by: SilverLight | last post by:
I need to write a C# windows application that can open a web page, fill in the fields and click the submit button on the web page automatically. I don't want to use the web browser control and have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.