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

  • Home
  • SEARCH
  • 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 8832909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:38:58+00:00 2026-06-14T08:38:58+00:00

Hey people I have a script that I found on the internet that can

  • 0

Hey people I have a script that I found on the internet that can login to facebook this works well but now I try on another website to log in I get the 500 error.

    Dim cookieJar As New Net.CookieContainer()
    Dim request As Net.HttpWebRequest
    Dim response As Net.HttpWebResponse
    Dim strURL As String = "http://xtract.basdistributie.nl:4040/Account/LogOn"

       Try 
        request = Net.HttpWebRequest.Create(strURL)
        request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
        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 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
        request.Method = "POST"
        request.AllowAutoRedirect = True
        request.CookieContainer = cookieJar

        Dim writer As StreamWriter = New StreamWriter(request.GetRequestStream())
        writer.Write("username=???????&password=????????")
        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()
        response.Close()

        If data.Contains("BAS Distribution Xtract") = True Then
            MsgBox("ingelogd")
        End If
        MsgBox(data)
    Catch e As Exception
        If TypeOf e Is WebException AndAlso DirectCast(e, WebException).Status = WebExceptionStatus.ProtocolError Then
            Dim errResp As WebResponse = DirectCast(e, WebException).Response
            ' read the error response
            Using respStream As Stream = errResp.GetResponseStream()
                MsgBox(e.ToString)
            End Using
        End If
    End Try

the error message finds place on response = request.GetResponse () I’ve also tried with Fidler to get a better error message but have never worked with this.I have also read about something on the internet that the error is because the website is built in asp instead of .net is this True?.

all help appreciated

  • 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-06-14T08:38:59+00:00Added an answer on June 14, 2026 at 8:38 am

    The reason that facebook’s login mechanism doesn’t work with this other site is because they probably don’t have the same login form parameters.

    Here’s how you should proceed (Although an exact answer is not possible at this point)

    1. Use your browser to navigate to the website you want to log into
    2. Examine the HTML of the login form to get the actual parameter names. For example this site might use ‘uname’ instead of ‘username’ and stuff like that.
    3. edit your code to POST a value for each input on the form

    If this doesn’t work:

    1. Install WireShark or something similar so you can view HTTP Traffic
    2. Navigate to the website with your browser
    3. Login with your browser and use wireshark to view the login request. Pay particular attention to the POST variable names and values and header information
    4. Update your script as appropriate

    If you need help with step 4 can you please edit your post to include information from step 3.

    WIRESHARK

    Below is a brief description on how you can use wireshark here. I’m not going into detail on filtering or anything like that. You can use your eyes to filter 😛

    When you open wireshark you are shown a list of interfaces. Step 1 is to select an interface…

    • if you are connected via wifi select one of the wlan interfaces. Hopefully there is only one. You can rely on trial and error to get the right one otherwise
    • if you are connected via a network cable then choose eth0. Hopefully there is only one etc etc.

    If the list of interfaces didn’t show up there should be an icon at the top left of the window that looks sortof like a printer. Clicking on it will let you select the interface (click Start to start capturing).

    Log in on your website (using your browser) and immediately stop the capture by clicking on the icno with the red x.

    Now you need to find the correct packet…

    The protocol you are interested in is HTTP. The name of the domain you are accessing might show up in the info column. For now I’m just going to assume that it does. If it doesn’t just say so as a comment. Also if you see SSL then this might be useless. I am not yet very knowledgeable on ssl…

    OK, so you can now identify the packets that you sent to the web app. Find one that says POST and see what’s inside it. If that’s your login stuff then it’s a win.

    Take note of all information that looks relevant.

    Now if you repeat the whole process using your application to try to login and find that login packet then you can play spot the difference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey people I'm new at jquery and i have been trying to figure this
hey guys having this really simple problem but cant seem to figure out have
Hey folks, I have a question which feels stupid but I can't quite say
Hey I have this code that sends an email with some data sent by
Hey people... trying to get my mocking sorted with asp.net MVC. I've found this
Hey people, why won't this code work? The Facebook API is so bad it's
Hey, I'm working on an iPhone app but I've heard from some people that
Hey people i have this structure for the search tree class State { //CLASS
Hey people. I see that this topic is repeated over and over on SO
Hey I've found a lot of people asking questions similar to mine but not

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.