i want to write a program which will download a file from internet.......but during that i want to show some updates of most likely like progress or so...... i came to know that i have to follow the IAsync...but no further could you please provide some useful info.

Using System.Net Class
Mach1
Denis Brasfield
srivastava
JimSmith
The new System.NEt WebClient has APIs for you to subscribe to the events of progress.
The following code should provide some guidance.
Let me know if you have more questions
#region Using directives
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Net;
using System.Net.Cache;
using System.Drawing;
using System.Windows.Forms;
#endregion
namespace WebClientTest
{
partial class frmWebClient : Form
{
WebClient wc = new WebClient();
public frmWebClient()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
wc.DownloadStringAsync(new Uri("/listener/default.htm">http://<yourmachinename>/listener/default.htm"));
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wc_DownloadProgressChanged);
}
void wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
this.progressBar1.Value = e.ProgressPercentage;
this.label1.Text = e.ProgressPercentage.ToString() + "% Completed";
}
void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
this.webBrowser1.DocumentText = e.Result;
}
}
}
Belsen
The timeout value choose is going to depend on several things...
Sunil_D
1) When you call WebRequest's async methods, the socket that is associated with that request is put in a completion port with pending read or write
2) one or more of the threads in the thread pool are waiting to
get notified of the completion port.
3) When the socket has data available to read or write, a thread in the thread pool wakes up and processes the read/write, then once it is done calls a callback.
Let me know if you would like to see a sample
In fact
http://blogs.msdn.com/feroze_daud/archive/2004/10/07/239562.aspx
is a very good start
TuscoGrocers
like System.Net.Cache is not available with System.Collections.Generic and the methods you callled wc.DownloadStringAsy are also not available
Prasadi de Silva
i am studying it will ask you if require further assistance.
Sheldon Penner
hytechpro
Try to increase until it succeeds. Then experiment with what could
be a reasonable value
Michael McCarthy
One thing you could do is to look at the Content-Length header of the response.
Then as you read the resonse you can compute the % and update a progress bar.
Thats what we do (in simple terms) for whidbey