Solved

Sending Data to a web server

Posted on 2002-03-06
7
282 Views
Last Modified: 2010-05-02
Hi all,
I want to connect to a site that request a user name and password fields from VB.
I want to to retrieve the next page (agetr the login page) and to do everything automatic from my VB program.
the site is a cgi site with jsp pages.
how do I do it? please send me a code example.
thanks,
Julian
0
Comment
Question by:Netsal7
7 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 6844817
use the web browser control: (Microsoft Internet Controls)

and do something like this:

Private Sub Command1_Click()
WebBrowser1.Navigate ("http://<url>")
While WebBrowser1.Busy
    DoEvents
Wend

'' obviously the "Form1" is name of form and "userName" is textbox for name and "userPass" is textbox for passwd
WebBrowser1.Document.Forms("Form1").Item("userName").Value = "<userName>"
WebBrowser1.Document.Forms("Form1").Item("userPass").Value = "<userPass>"
WebBrowser1.Document.Forms("Form1").Submit

MsgBox WebBrowser1.Document.body.innerHTML

End Sub
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 100 total points
ID: 6844820
repost so it looks nicer

Private Sub Command1_Click()
WebBrowser1.Navigate ("<url>")
While WebBrowser1.Busy
   DoEvents
Wend

'' obviously the "Form1" is name of form and "userName" is textbox for name and "userPass" is textbox
for passwd
WebBrowser1.Document.Forms("Form1").Item("userName").Value = "<userName>"
WebBrowser1.Document.Forms("Form1").Item("userPass").Value = "<userPass>"
WebBrowser1.Document.Forms("Form1").Submit

MsgBox WebBrowser1.Document.body.innerHTML

End Sub
0
 

Author Comment

by:Netsal7
ID: 6847176
and id the site uses SSL?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Expert Comment

by:inthedark
ID: 6847202
Do you need a visual inteface or are you making a background DLL/Service?
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 6847448
the above code doesn't work for a site using ssl?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7610504
Hi Netsal7,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept bobbit31's comment(s) as an answer.

Netsal7, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:modulo
ID: 7657345
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now