[HELP]

Posts 1–10 of 10 · Page 1 of 1
[HELP]
How Would I make a register Form on my VB.net program?? and once they register on the program it registers on the website

i have

User name
password
password again
email.
use webbrowser1.getelementbyid

send me a pm with a link to your website and I'll help you.


Code:
    'navigate to register form

        WebBrowser1.Navigate("http://your website.com/register.php?")
Code:
 'check checkbox
        WebBrowser1.Document.GetElementById("cb_rules_agree").Focus()


        SendKeys.Send(" ")
Code:
'hit button
WebBrowser1.Document.Forms(2).InvokeMember("submit")

Code:
'fill in data
 WebBrowser1.Document.GetElementById("regusername").InnerText = User.Text
        WebBrowser1.Document.GetElementById("password").InnerText = pw.Text
        WebBrowser1.Document.GetElementById("passwordconfirm").InnerText = confirmpw.Text
        WebBrowser1.Document.GetElementById("email").InnerText = email.Text
        WebBrowser1.Document.GetElementById("emailconfirm").InnerText = confirmemail.Text
Code:
'coplete registration
WebBrowser1.Document.Forms(2).InvokeMember("submit")
Where Do i put all that??

Heres a pic of what it looks like

figure it out on your own.
I Cant.. im tired, and just want to finish it.. this whole project is making me COnfused.
please tell me where to put it :P
it's your decession where to put it on...on form_load for example, make sure you are using do while readystate <> completed
application.doevents
loop

to actually make sure you are filling in the data AFTER the page is loaded...

well I gave you all the code you should be able to actually c&p it <.<
Would it work if i put a " Submit " button on the form and c&p the code to that?
Quote Originally Posted by MintSlice View Post
Would it work if i put a " Submit " button on the form and c&p the code to that?
C&P will never work, try figuring out something by yourself
We will love to help, because at one point or another we all need it, however, The information you gain here is not meant to be copied and pasted, in fact doing so will give you errors on a-lot of occasions seeing as we may use different declarations etc.

it is better to take the information and read it as opposed to copy it straight out of here (which is the norm around here)

The fact that you blocked out what multi tool you are creating does not help either, If I want to help you locate the Element ID, we would need to know the site, You can do it yourself though .


What you will be using is called DOM , DOM = Document Object Model a set class of API used to defines the logical structure of documents(Html, XMl, etc) and the way a document is accessed and manipulated inside of your application .

So lets look at a few examples.

Lets say you wanted your application to have a RichTextBox that gets filled with the contents of a specific form on a website.

You could use

[php]
RichTextBox1.Text = WebBrowser1.Document.GetElementById("Form ID Name").GetAttribute("value")
[/php]

It may be a little different of a code depending on what the website designer user Values, Textbox's, etc etc.

Knowing the basic concepts of HTML or web design helps as well because you will need to understand it's structure to make it work.

<table id=table>
<tr>
<td>
</td>
</tr>
</table>

(I went to hit Ctrl + K Crtl D to format the html...force of habbit....)

The code above creates a single element table, its id is "table" and that table has a tag called "td"

so knowing that you can grab the information from that table and display it in a table on your application

[php]

Dim TableID As HtmlElement = WebBrowser1.Document.GetElementById("table")

[/php]

Once you get the ElementID you should be able to grab any tags (it is declared as a html element)

[php]
Dim Info as TableID.GetElementsByTagName("tr") (or span or anything really)
[/php]

Now send that information somewhere

[php]
textbox1.text = info
[/php]


In your case, you want to work in reverse, you want to grab the ElementId and post information to that

so on a button Click event you want to do as blubb said

[php]
Webbrowser1.Documents.GetElementsByid("Element Id").innertext(textbox1.text)
[/php]

What this does is grab the elementid and passes the information over to the webbrowser element.


Hope this helps
well my code is already matched to his homepage...i did search out the ids for him...he can just c&p it...
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us