|
-
Sep 7th, 2009, 08:36 AM
#1
Thread Starter
Lively Member
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.
-
Sep 7th, 2009, 04:30 PM
#2
Re: HowTo Login To A Website Using Vb
try like this, there are several other ways
vb Code:
Set wb = CreateObject("internetexplorer.application") wb.navigate2 "http://www.ebharatgas.com/ebgas/pages/index.jsp" Do Until wb.readystate = 4 DoEvents ' wb.Quit Loop wb.Visible = True With wb.document.forms("login") .all("wblogid").Value = "username" .all("wbpasswd").Value = "pass" .submit 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
-
Sep 8th, 2009, 03:59 AM
#3
Thread Starter
Lively Member
Re: HowTo Login To A Website Using Vb
 Originally Posted by westconn1
try like this, there are several other ways
vb Code:
Set wb = CreateObject("internetexplorer.application")
wb.navigate2 "http://www.ebharatgas.com/ebgas/pages/index.jsp"
Do Until wb.readystate = 4
DoEvents
' wb.Quit
Loop
wb.Visible = True
With wb.document.forms("login")
.all("wblogid").Value = "username"
.all("wbpasswd").Value = "pass"
.submit
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
-
Sep 8th, 2009, 04:07 AM
#4
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
-
Sep 8th, 2009, 04:28 AM
#5
Thread Starter
Lively Member
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]
-
Sep 8th, 2009, 05:08 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|