Results 1 to 6 of 6

Thread: How To Login To A Website Using Vb[Resolved]

  1. #1

    Thread Starter
    Lively Member _-Rs-_'s Avatar
    Join Date
    Aug 2009
    Posts
    84

    Resolved How To Login To A Website Using Vb[Resolved]

    Hi There I Am Trying To Learn Vb So I Was Thinking To Try To Make A
    vb application That Will Login In To Website But I Have No Idea What To Do
    for example I Have This Website www.ebharatgas.com I Want To Login To That Website From My application is it possible If Yes How?
    Last edited by _-Rs-_; Sep 8th, 2009 at 05:09 AM.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: HowTo Login To A Website Using Vb

    try like this, there are several other ways
    vb Code:
    1. Set wb = CreateObject("internetexplorer.application")
    2. wb.navigate2 "http://www.ebharatgas.com/ebgas/pages/index.jsp"
    3. Do Until wb.readystate = 4
    4.     DoEvents
    5. '    wb.Quit
    6. Loop
    7. wb.Visible = True
    8. With wb.document.forms("login")
    9.     .all("wblogid").Value = "username"
    10.     .all("wbpasswd").Value = "pass"
    11.     .submit
    12. End With
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Lively Member _-Rs-_'s Avatar
    Join Date
    Aug 2009
    Posts
    84

    Question Re: HowTo Login To A Website Using Vb

    Quote Originally Posted by westconn1 View Post
    try like this, there are several other ways
    vb Code:
    1. Set wb = CreateObject("internetexplorer.application")
    2. wb.navigate2 "http://www.ebharatgas.com/ebgas/pages/index.jsp"
    3. Do Until wb.readystate = 4
    4.     DoEvents
    5. '    wb.Quit
    6. Loop
    7. wb.Visible = True
    8. With wb.document.forms("login")
    9.     .all("wblogid").Value = "username"
    10.     .all("wbpasswd").Value = "pass"
    11.     .submit
    12. End With
    Bro Thanks For The Reply But I Am Newbie Still I Did Try To use To Code But Wen I Run It nothing Opens No Error nothing Can U explain in detail or make a example source Please Please Please

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: HowTo Login To A Website Using Vb

    how did you run it?

    i tested this, so i know it works, just as is

    put the code in the click event of a command button or something
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5

    Thread Starter
    Lively Member _-Rs-_'s Avatar
    Join Date
    Aug 2009
    Posts
    84

    Re: HowTo Login To A Website Using Vb

    thanks For The Help Bro I Made It To Work Thank You So Much
    Last edited by _-Rs-_; Sep 8th, 2009 at 05:11 AM. Reason: [Resolved]

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: HowTo Login To A Website Using Vb

    well you have to do like, assuming username is the name of your textbox
    WebBrowser1.Document.All("wblogid").Value = username.text
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width