Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2007, 07:26 PM
Authorized User
 
Join Date: Sep 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default ProgressBar on httpwebrequest

Hello,

I consider myself a beginner/intermediate programmer in c#, but there's one thing that I've always had a problem with -- the progressbar object. I have yet to find a good tutorial on how to use the progressbar for different processes, other than a simple timer.

What I'm trying to do is have a progressbar similar to that on any browser, that shows the progress of the page download/request using the httpwebrequest object. I'm sure there are methods out there in the .NET framework that would give me the file size of a web file, but I'm not sure if that's the best approach. I am doing two different things where I'd like a progressbar. The main one that I'm having trouble with is a login request. I'd like the progressbar to show how long it's taking to login to the site and have the webbrowser object show the HTML data. Can anyone help me with this?

Some decent video or document tutorials would be appreciated, but sample code would be fantastic!

Thanks in advance!

Panuvin

 
Old February 5th, 2007, 03:24 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The inherent problem with what you are looking to do is this: How does (or *can*) your process know how long it *should* take for a login to occur? Unless you establish some expectation of execution time, you can't show progress.

In contrast, if you were downloading a file, you would first get the size of the file, and then your process can establish how complete it is by knowing how many bytes it has downloaded relative to the total.

If you have a process that is made up of many steps, you could potentially show the progress by knowing how many steps total and how many steps completed so far.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
HttpWebRequest over SSL Suhrit ASP.NET 2.0 Professional 0 December 7th, 2006 03:41 AM
progressbar vnt C# 0 May 11th, 2005 08:14 PM
Progressbar ! minhtri Classic ASP Basics 3 June 1st, 2004 11:47 AM
ProgressBar and long event Ciarano VB How-To 6 April 1st, 2004 05:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.