Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 26th, 2012, 02:38 PM
CrazyVB CrazyVB is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2012
Posts: 2 CrazyVB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 36 sec
Reputation Power: 0
Question How to get that button name?

Okay guys,
I've been making this program to log in to a web page, I have done so that it can write the inputed text in the username and password textboxes, using these comands:
Code:
Code:
webpage.Document.GetElementById("name").SetAttribute("value", username.Text)
webpage.Document.GetElementById("pass").SetAttribute("value", password.Text)

------------------------
The button clicking comand shuld be this:
Code:
Code:
 webpage.Document.GetElementById("button-name").InvokeMember("click")

------------------------
But I can't get the button ID the same way i got the textboxes' ID, here is a snippet of the page:
The ID's of the textboxes are there (name="") but the button's ID isn't.
HTML Code:
Code:
</div>
<form action="/user/login"  accept-charset="UTF-8" method="post" id="user-login">
<div><div class="content_frame" style="margin-right: 100px; margin-top: 15px;">

	<div class="page_form_container">

    	<div class="form-item">

        	<label for="name" style="font-size: 16px; font-weight: bold;">Username:</label>

            <input type="text" name="name" id="name" value="" />

        </div>

        <div class="form-item">

            <label for="pass" style="font-size: 16px; font-weight: bold;">Password:</label>

            <input type="password" name="pass" id="pass" value="" />

        </div>

    	

        <input type="submit" value="Log In" style="margin-left: 150px; margin-right: 0px;" class="popup_button form-submit" />

        

	    <div class="popup_button" style="float: right; margin-right: 10px;">

	        <a href="http://signup.PAGE.com">Create Account</a>	    </div>

	    

		<div style="margin-bottom: 15px; margin-left: 150px; margin-top: 25px;">

        	<a href="/account/recovery/username">Forgot Username? | </a>

        	<a href="/account/recovery/password">Forgot Password?</a>

    	</div>

    <input type="hidden" name="form_id" value="user_login" />

	</div>

</div>
</div></form>

I need help fast,
Thanks for your time,
CrazyVB

Reply With Quote
  #2  
Old March 27th, 2012, 12:39 AM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Apr 2004
Location: OAKLAND CA | Adam's Point (Fairyland)
Posts: 14,938 medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 6 Months 2 Weeks 2 Days 26 m 49 sec
Reputation Power: 8490
Facebook
There is no ID, there really is no button defined, it's a submit form action "submit"
__________________
medialint.com

“Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss

Reply With Quote
  #3  
Old March 27th, 2012, 07:20 AM
CrazyVB CrazyVB is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2012
Posts: 2 CrazyVB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 36 sec
Reputation Power: 0
Question

Quote:
Originally Posted by medialint
There is no ID, there really is no button defined, it's a submit form action "submit"

But how can I, after using this:
Code:
webpage.Document.GetElementById("name").SetAttribute("value", username.Text)
webpage.Document.GetElementById("pass").SetAttribute("value", password.Text)


Make the form/web page actualy login?

Reply With Quote
  #4  
Old March 28th, 2012, 02:12 AM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,239 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 15 h 17 m
Reputation Power: 4445
Creating a web based login system takes some work. I recommend you start with finding and downloading some open-source applications that do login and take a look at the coding done by those developers to get some ideas.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > How to get that button name?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap