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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:57:02+00:00 2026-05-25T21:57:02+00:00

I think this is a simple question for you, but I don’t understand other

  • 0

I think this is a simple question for you, but I don’t understand other cases of webRequests, so I asked here:

How can I make this webRequest asynchronous?

Dim sBuffer As String
Dim oRequest As WebRequest = WebRequest.Create(url)
oRequest.Method = "GET"
Dim oResponse As WebResponse = oRequest.GetResponse()
Dim oStream As New StreamReader(oResponse.GetResponseStream())
sBuffer = oStream.ReadToEnd()
oStream.Close()
oResponse.Close()
Return sBuffer

Thank you for your help!

Regards, Flo

  • 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-25T21:57:03+00:00Added an answer on May 25, 2026 at 9:57 pm

    a function with a simple return value cannot be sinmply made asynchronous, you need to find another method of handling the data that comes back. I would suggest using System.Net.WebClient which is a much easier wrapper on what you’ve done above, with this class asynch is really easy.

    Dim wc As New WebClient
    AddHandler wc.DownloadStringCompleted, AddressOf DownloadCompletedHander
    wc.DownloadStringAsync(url)
    

    …

    Public Shared Sub DownloadCompletedHander(ByVal sender As Object, ByVal e As DownloadStringCompletedEventArgs)
        If e.Cancelled = False AndAlso e.Error Is Nothing Then
            Dim myString As String = CStr(e.Result)
            'Do stuff with data
        End If
    
    End Sub 
    

    I don’t really speak VB.net but i think thats right from some googling

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

Sidebar

Related Questions

i think this is a simple question but I've searched around and can't seem
I think this is a simple question, but I can not find the answer
I think this is a relatively simple question, but I don't precisely know what's
I'm hoping this question has a very simple answer. I can think of ways
(I don't think I have titled this question correctly - but I don't know
I'm sorry that I put this question because I think that is simple but
Simple question, I don't think it's possible but have been surprised before. I have
A long explanation but I believe this is a pretty simple question. I think
I think this is a simple question. How do I disable copy from a
I think this is a pretty simple question. How do you an apache rewrite

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.