Click here to Skip to main content
12,763,226 members (31,766 online)
Rate this:
Please Sign up or sign in to vote.
See more: VS2010
Hello everyone,I'm new at visual basic and I try auto login for website

Well,I'm stucked somewhere

I can insert id and pw but cant press login button because there's no div name?

Here's the code

<form name="giris" method="POST" action="/auth/signin">
            <input class="data-input" placeholder="Kullanıcı Adı" name="kullanici_adi">
            <input class="data-input" placeholder="Şifreniz" type="password" name="kullanici_sifre">
            <input type="submit" value="Giriş Yap" class="buton"><br>

My vb code is

WebBrowser1.Document.GetElementById("kullanici_adi").SetAttribute("nick", TextBox1.Text)
 WebBrowser1.Document.GetElementById("kullanici_sifre").SetAttribute("sifre", TextBox2.Text)
Posted 12-Nov-12 12:19pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

You try to set attributes with names like nick and sifre. This variable names doesn't exist. Try to set the value attribute. Also, to simulate a click, don't use this code:

But use this code:

Hope this helps.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Don't do the wrong thing and then apologise. If you wanted to apologise, you wouldn't have done it. Your code won't work. You clearly are a beginner, and that is fine, but you're very confused right now. Buy a book and work through it. The web form won't work as 'button' is misspelled. You can use Document.Forms(0).Submit, if the browser object supports it, but learning to use VB to call javascript methods is not a sane way to learn VB, it's really kind of pointless. Write VB programs, not just code against the browser control, which is not really that useful, and is only going to teach you to call existant APIs, not write real code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100