Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7601133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:05:41+00:00 2026-05-30T23:05:41+00:00

I am a newb to vb.net(visual studio 2008).i am trying to make an app

  • 0

I am a newb to vb.net(visual studio 2008).i am trying to make an app using vb.net which can be used to login to a website and browse that website without using webbrowser(i dont want to use webbrowser of vb.net).i got a code for this from net ;I have made a temporary login webpage using php and mysql in my computer(its working properly).
but when i tried to login using vb.net its not working…
because i dont know in which part of the code is not working,i am pasting the whole code here.

below is my html code for login form

    <td style="width: 188px;"><input maxlength="120" size="30" name="login" class="css"  id="login"><br>
<br>
</td>
</tr>
<tr>

<td><b>Password</b></td>
<td><input maxlength="100" size="30" name="password" class="css" id="password" type="password"><br>
<br>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input name="submit" value="Login" class="button" type="submit"></td>

this is the vb.net code that i got it from net.i changed the url to my localhost website..and added username and password(both root) and also this <big>Welcome

Imports System.Net
Imports System.Text
Imports System.IO

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim cookieJar As New Net.CookieContainer()
        Dim request As Net.HttpWebRequest
        Dim response As Net.HttpWebResponse
        Dim strURL As String

        Try
            'Get Cookies
            strURL = "http://localhost/login.php"
            request = Net.HttpWebRequest.Create(strURL)
            request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"
            request.Method = "GET"
            request.CookieContainer = cookieJar
            response = request.GetResponse()

            For Each tempCookie As Net.Cookie In response.Cookies
                cookieJar.Add(tempCookie)
            Next

            'Send the post data now
            request = Net.HttpWebRequest.Create(strURL)
            request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"
            request.Method = "POST"
            request.AllowAutoRedirect = True
            request.CookieContainer = cookieJar

            Dim writer As StreamWriter = New StreamWriter(request.GetRequestStream())
            writer.Write("login=root & password=root")
            writer.Close()
            response = request.GetResponse()

            'Get the data from the page
            Dim stream As StreamReader = New StreamReader(response.GetResponseStream())
            Dim data As String = stream.ReadToEnd()
            RichTextBox1.Text = data
            WebBrowser1.DocumentText = RichTextBox1.Text
            response.Close()

            If data.Contains("<big>Welcome") = True Then
                'LOGGED IN SUCCESSFULLY
            End If

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class

Thanks for your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:05:43+00:00Added an answer on May 30, 2026 at 11:05 pm

    This method just works for websites which use URL parameter. Make sure you can login to your site like this:

    http://localhost/login.php?user=your_username&password=your_password
    

    Also remove spaces here:

    writer.Write("login=root&password=root")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Ruby (newb) and Regex, I'm trying to parse the street number from the
As of right now I am trying to create an ASP.NET page which will
Super simple question from an ASP newb: I've got an internal-only ASP.NET website I'm
I hope you guys can help me out. I'm using C# .Net 4.0 I
I'm still a newb when it comes to using regular expressions. I am trying
Basically what the title says. (Forgive me because I am a .NET newb) In
I'm clearly a newb, and I was wondering if anyone knows how I can
ASP.NET MVC3 newb here. I am working on a MVC3 intranet application that uses
I'm writing an iPhone app which downloads a tar-gzipped file from a Webserver, then
Total newb to .NET programming (and AJAX) but I've been working on this program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.