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 7945489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:52:50+00:00 2026-06-04T00:52:50+00:00

I am working on a vb.net 2.0 application and trying to read HTTP headers.

  • 0

I am working on a vb.net 2.0 application and trying to read HTTP headers. I am able to get header values through Request.Headers.Get(“HTTP_VARIABLE_NAME”). I would like to get all header name/value pairs using Headers property and display on a separate page under a button click event from a given page.

How can I loop and write all name/value pairs please?

  • 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-04T00:52:52+00:00Added an answer on June 4, 2026 at 12:52 am

    Taken directly from MSDN, so all credit goes to the poor Microsoft employee who was given the rough task of documenting the system.net namespace. Although I do feel like I could write a better example myself…

    The following code example displays the names and values of all headers in the HTTP request

    Dim loop1, loop2 As Integer
     Dim arr1(), arr2() As String
     Dim coll As NameValueCollection
    
    
    ' Load Header collection into NameValueCollection object.
    coll=Request.Headers
    
    ' Put the names of all keys into a string array.
    arr1 = coll.AllKeys 
    For loop1 = 0 To arr1.GetUpperBound(0)
       Response.Write("Key: " & arr1(loop1) & "<br>")
       arr2 = coll.GetValues(loop1) 
       ' Get all values under this key.
       For loop2 = 0 To arr2.GetUpperBound(0)
          Response.Write("Value " & CStr(loop2) & ": " & Server.HtmlEncode(arr2(loop2)) & "<br>")
        Next loop2
     Next loop1
    

    I don’t know what you mean by “write to a page”, but this should get you started.

    Is there a reason that forces you to use .NET 2? .NET 4 is still supported on Windows XP SP3 and up and offers many advantages over previous versions. Just putting it out there.

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

Sidebar

Related Questions

I'm working on an asp.net/C# application, and trying to get a radiobox to invoke
I'm trying to get Quartz.net working by embedding into my .Net MVC2 application. I
I'm trying to check what framework version a other .NET application is working with
I am working on a VB.Net Windows application. I am trying to use MaskedTextBox
When working with an ASP.Net application, when I rebuild the solution, I would like
I'm trying to get Twitter authentication working on my ASP.NET site. When you create
I'm trying to extend the functionality of an ASP.net application that I'm working with.
I'm trying to use application settings with a C#.NET project I am working on.
I have a little sample application I was working on trying to get some
I'm working with the NerdDinner application trying to teach myself ASP.NET MVC. However, I

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.