Solved

Sending Data to a web server

Posted on 2002-03-06
7
284 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

856 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