Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Non-Web Async and Await Questions

Non-Web Async and Await Questions

Scheduled Pinned Locked Moved Visual Basic
csharptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11309507
    wrote on last edited by
    #1

    I'm trying to use a progress bar in a .Net 4.5 application while calling a method that doesn't return for 5-7 seconds. This is a simple application, but the examples I've seen are either based on file operations or web operations. Since mine is neither I'm unclear as to: 1) What type of async method to use? 2) For the await method what type of .NET method do I use (e.g., .DownloadStringTaskAsync)? I'm trying to use Furytrader post 'Simple .Net progress bar using async/await', 2/18/2014, but I'm struggling. Example code is a lot to ask for but mod's to Furytrader's post might be easier.

    U B 2 Replies Last reply
    0
    • U User 11309507

      I'm trying to use a progress bar in a .Net 4.5 application while calling a method that doesn't return for 5-7 seconds. This is a simple application, but the examples I've seen are either based on file operations or web operations. Since mine is neither I'm unclear as to: 1) What type of async method to use? 2) For the await method what type of .NET method do I use (e.g., .DownloadStringTaskAsync)? I'm trying to use Furytrader post 'Simple .Net progress bar using async/await', 2/18/2014, but I'm struggling. Example code is a lot to ask for but mod's to Furytrader's post might be easier.

      U Offline
      U Offline
      User 11078627
      wrote on last edited by
      #2

      With a bit more investigation, it was apparent that the time consuming task in this example, retrieving a string from a website, was effectively driving the frequency that the progress bar was updated -- retrieve a string then update the progress bar. My problem is that the task I'm calling does not return for several seconds and it is during this time that I want to be updating the progress bar since the task is a blocking task. How do I call such a task and also be updating the progress bar?

      1 Reply Last reply
      0
      • U User 11309507

        I'm trying to use a progress bar in a .Net 4.5 application while calling a method that doesn't return for 5-7 seconds. This is a simple application, but the examples I've seen are either based on file operations or web operations. Since mine is neither I'm unclear as to: 1) What type of async method to use? 2) For the await method what type of .NET method do I use (e.g., .DownloadStringTaskAsync)? I'm trying to use Furytrader post 'Simple .Net progress bar using async/await', 2/18/2014, but I'm struggling. Example code is a lot to ask for but mod's to Furytrader's post might be easier.

        B Offline
        B Offline
        bojammis
        wrote on last edited by
        #3

        Howdy - you might try using a Background worker for this task. The Background worker class provides a straight forward method to update progress bars etc.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups