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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:15:46+00:00 2026-06-08T06:15:46+00:00

Im getting used to Visual Basic currently and im trying to build an application

  • 0

Im getting used to Visual Basic currently and im trying to build an application that our operators can submit quick searches to one of our systems. – I have looked around for this and I couldnt find a lot of information

Below is a quick overview on what we would like to achieve somehow

1. VB 2010 App (2 x Text Boxes + Button) 
2. PHP Script (If query = bob & jones <<=
3. Curl PHP Request to another PHP Form
4. Returns to Original PHP Script <<= 
5. Somehow returns information back to .net application that is waiting

I am a PHP Programmer rather than a .net developer mainly so the curl and php scripts are mostly complete its just the .net coding

To get us started we used the following code :

    Dim webStream As Stream

    Dim webResponse = ""

    Dim req As HttpWebRequest

    Dim res As HttpWebResponse

    ' API Address ''

    req = WebRequest.Create("xxxxxxxxx")



    req.Method = "GET" ' Method of sending HTTP Request(GET/POST)

    res = req.GetResponse() ' Send Request



    webStream = res.GetResponseStream() ' Get Response

    Dim webStreamReader As New StreamReader(webStream)

    ' READ Response in one Variable

    While webStreamReader.Peek >= 0

        webResponse = webStreamReader.ReadToEnd()

    End While
    MsgBox(webResponse)

It was working fine to one standard because it was bringing the information back to us in the form of a messagebox , albeit we wanted it to populate a few text boxes (Not even sure if that is possible)

But the main problem was that it was retrieving the source code of the website instead of just information on the text side of the website

Thanks

  • 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-08T06:15:48+00:00Added an answer on June 8, 2026 at 6:15 am

    You seem to have this part way completed already. you have the markup, just dig into it.

    Here is an alternate way of writing your code above.

    Dim MyURL as string = "xxxxxxx"
    Dim MyRequest As WebRequest = WebRequest.create(MyURL)
    MyRequest.Headers.Add("myCustom","true") 'PHP Web Server @ xxxxxxx will see this as $_SERVER['http_myCustom'] - true
    MyRequest.ContentType = "text/html"
    MyRequest.Method = "GET"
    
    Dim MyResponse As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
    
    If MyResponse.StatusCode = HttpStatusCode.OK Then
        Dim SR As New StreamReader(MyRequest.GetResponseStream())
        MyRequest.Close()
        Dim webResponse As String = SR.ReadToEnd()
        SR.Close()
    
        'At this point, the source of the page is in webResponse
    
    Else
        MyRequest.Close()
        'Error in connection to remote/host server
    End If
    

    I added the Header to the request to show that you could simply check for the existence of this header, and/or the referrer, on the external site to handle the response by that site differently.. that is, if you don’t want to parse the entire source in webRequest, than you should consider not sending an entire document from the external site.

    For, I assume you’re just interested in getting search results that are parsed to text/html by the external server.

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

Sidebar

Related Questions

I used the SystemEnvironment class in Java for getting system information. In that I
Up until now I used DateTime.Now for getting timestamps, but I noticed that if
I have been working on getting a basic ATL project to compile in Visual
I have a Visual Studio setup project that installs an application into the task
I'm quite new to Visual Basic - using Visual Studio 2008 and can't seem
I'm getting used to using nant for build releases. But I have started to
I am using C++ with Visual Studio 2010. I am trying to build a
I am getting a compilation error when trying to build a C++ project which
I'm trying to rebuild an old metronome application that was originally written using MFC
I have been getting an error message that I can't resolve. It originates from

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.