Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi !

 

I am trying to log into my website via my vb.net application. The html code i am using on my site is very simple:

<form method="POST" action="check.php">
Username: <input name="username" type="text" size="20" value="">
Password: <input name="password" type="password" size="20" value="">
<input type="submit" value="Login"></form>

When the information is posted, check.php redirects you to 'good.html' if the username & password is valid.

 

I am trying to get my application to login to the website and download the html source from 'good.html'. To download the source from websites I usually use this code:

Dim sr As IO.StreamReader
Dim wc As New Net.WebClient()
sr = New IO.StreamReader(wc.OpenRead("http://localhost/index.html"))
Dim s As String
s = sr.ReadToEnd
sr.DiscardBufferedData()
sr.Close()
wc.Dispose()
txtInfo.Text = s

However i have no idea how to post the login information, can anybody please give me some clues on how to do it?

 

Thanks!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...