We help IT Professionals succeed at work.

Getting/Sending info to internet

Hi Experts,

I need to create a program in VB where i can connect to a web site, pass on a user name and pwd to that site and get back an integer that says if my pwd was accepted.
How can I do this?

Thanks
Comment
Watch Question

Commented:
Read: Retrieving secured resources from the Web
http://www.vbip.com/winsock/winsock_http_04_01.asp

and download the sample project.

You'ld send username & password base64-encoded in the request header and parse the response header.
If authentification failed, the first line of the response header will contain the code "401" (else any other code, like "200 OK").

Commented:
Create a DLL with some validation code.
Pass the return parameters using variants:

Public Function CheckLogin(ByVal sUserName As String, ByVal sPassword As String) As Variant

'some coding for checking here

    CheckLogin = bLoggedInOk

End Function

Put the DLL in MTS on the IIS server.

Create an asp page for a login.
In the submit of the form do something like:

Dim oLogin, bResult
Set oLogin = Server.CreateObject("LoginDLL")

bResult = CBool(oLogin.CheckLogin(window.txtLogin.Value, window.txtPassword.Value))

If Not bResult Then
  window.location = "loginfailure.asp"
Else
  window.location = "loginsuccesfull.asp"
End If

D'Mzzl!
RoverM

Author

Commented:
Hi Robbert, thanks for the help, it's what I need.
I'll leave this quesion open for a while, but I'll give you the points.
Do you know of any methods like that to post a file on the server?

Thanks allready

Catouch

Author

Commented:
Found everything i needed,
Thanks

Explore More ContentExplore courses, solutions, and other research materials related to this topic.