473,503 Members | 6,587 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmtically Fill in a form?

How can programmatically I fill in a form on a web page in VB? This is in a
desktop program and I am using Webclient right now to get info on a page.
In some cases it asks me to login and I want it to be automatic.

Any suggestions welcome.

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
Oct 5 '08 #1
2 3952
Anil Gupte/iCinema.com wrote:
How can programmatically I fill in a form on a web page in VB? This is in a
desktop program and I am using Webclient right now to get info on a page.
In some cases it asks me to login and I want it to be automatic.
If you fill in a form on a "web page" and submit that then a HTTP
request is made that sends the form data. You can do that with WebClient
or with WebRequest, check the HTML document of the page to find out the
control names in the form, the action URI attribute to submit to and the
request method (e.g. GET or POST), then program the corresponding
request with WebClient or WebRequest.

WebClient has methods like this
http://msdn.microsoft.com/en-us/library/900ted1f.aspx to make a GET or
POST request with a collection of data.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Oct 5 '08 #2
Thanx Martin:
I got a little further as you suggested. I was already using WebClient, so
was able to follow a link using

Dim WCInstance As WebClient = New WebClient
returnValue = WCInstance.DownloadData(ItemURL)

then parse that page and follow the signon link. Now when I get to the
login form I have:

<form name="loginForm" id="loginForm" method="post">
<input type="hidden" name="current_form" value="loginForm" />

so there is nothing poiting to a URL to submit to and the submit button uses
JavaScript to submit:

<div class="action-button" style="" id="button-signin">
<a id="button-signin-link" href='#'
onclick='document.getElementById("loginForm").subm it(); return false;'>
<div class="end-cap img-action-button-cap-left"></div>
<div class="content hand"><span class="title" id="button-signin-title"
>Sign In</span></div>
<div class="end-cap img-action-button-cap-right"></div>
</a>
</div>
<input type="hidden" name="action_login" value="Log In">

I am not sure how to proceed. Please advise.

--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
"Martin Honnen" <ma*******@yahoo.dewrote in message
news:O%****************@TK2MSFTNGP06.phx.gbl...
Anil Gupte/iCinema.com wrote:
>How can programmatically I fill in a form on a web page in VB? This is
in a desktop program and I am using Webclient right now to get info on a
page. In some cases it asks me to login and I want it to be automatic.

If you fill in a form on a "web page" and submit that then a HTTP request
is made that sends the form data. You can do that with WebClient or with
WebRequest, check the HTML document of the page to find out the control
names in the form, the action URI attribute to submit to and the request
method (e.g. GET or POST), then program the corresponding request with
WebClient or WebRequest.

WebClient has methods like this
http://msdn.microsoft.com/en-us/library/900ted1f.aspx to make a GET or
POST request with a collection of data.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Oct 8 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4847
by: Moozie | last post by:
I have a form that people can fill out. Link looks like: http://www.myname.com/form.php A regular form, nothing special. Now I would like to fill out 1 field automatically by the link I give...
5
11542
by: Johnny Meredith | last post by:
I have seven huge fixed width text file that I need to import to Access. They contain headers, subtotals, etc. that are not needed. There is also some corrupt data that we know about and can...
6
1608
by: JeffB | last post by:
I have tried several different methods of getting a datagrid to fill with information. Below is the code I'm now using. When viewed in the browser and the text box filled with a parameter value...
0
1257
by: tshad | last post by:
MSN has a toolbar that has a Form Fill function that will try to fill form fields on forms when they come up. The problem is that it causes problems with some forms and functions. I found this...
7
10838
by: the_grove_man | last post by:
How do I invoke a "Right-Click" Programmtically? John
10
1899
by: Anil Gupte | last post by:
I am playing a Windows Media File which is protected by their DRM. I want to be able to automatically fill in the form asking for payment with my saved parameters. Is there any way to do this? ...
2
4362
by: nte | last post by:
Hi. I have a site where users can open their profiles and provide some personal data. On a user's button click, I want to open a new window and show some page that is hosted on another...
1
7476
by: Steve Richter | last post by:
I have a form. In the Form is a MenuStrip and a FlowLayoutPanel. In the FlowLayoutPanel is a ListBox. The FlowLayoutPanel is set to DockStyle.Fill. The ListBox is set to AnchorStyles.Left |...
4
4339
by: MichaelK | last post by:
Hello. I have all data already collected on the current page? I want to open another window with the form, fill the fields and submit that form. So basically the question is how can I fill all...
0
7193
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
7264
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
7316
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...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
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
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.