Click here to Skip to main content
15,887,936 members
Home / Discussions / C#
   

C#

 
QuestionRe: Server/Client App. Pin
Dan Mos30-Apr-12 0:19
Dan Mos30-Apr-12 0:19 
QuestionRe: Server/Client App. Pin
jojoba201130-Apr-12 17:25
jojoba201130-Apr-12 17:25 
QuestionHow to stop downloading progress in WebClient? Pin
amx_tiger29-Apr-12 20:27
amx_tiger29-Apr-12 20:27 
AnswerRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen30-Apr-12 4:55
professionalEddy Vluggen30-Apr-12 4:55 
GeneralRe: How to stop downloading progress in WebClient? Pin
amx_tiger30-Apr-12 5:15
amx_tiger30-Apr-12 5:15 
AnswerRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen30-Apr-12 5:33
professionalEddy Vluggen30-Apr-12 5:33 
GeneralRe: How to stop downloading progress in WebClient? Pin
amx_tiger30-Apr-12 5:43
amx_tiger30-Apr-12 5:43 
AnswerRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen30-Apr-12 5:55
professionalEddy Vluggen30-Apr-12 5:55 
amx_tiger wrote:
Something like this.

Something like that should work. The one below has been tested and works;
C#
WebClient wc = new WebClient();

public Form1()
{
	InitializeComponent();
}

void Button1_Click(object sender, EventArgs e)
{
	wc.DownloadFileCompleted += delegate { Text="Done"; };
	wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wc_DownloadProgressChanged);
	wc.DownloadFileAsync(
		new Uri(@"http://dumps.wikimedia.org/nnwiki/20120430/nnwiki-20120430-pages-meta-history.xml.bz2"),
		"test.data");
}

void wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
	Text = e.BytesReceived.ToString();
}

void Button2_Click(object sender, EventArgs e)
{
	wc.CancelAsync();
}

Bastard Programmer from Hell Suspicious | :suss:

GeneralRe: How to stop downloading progress in WebClient? Pin
amx_tiger30-Apr-12 6:09
amx_tiger30-Apr-12 6:09 
QuestionRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen30-Apr-12 6:16
professionalEddy Vluggen30-Apr-12 6:16 
AnswerRe: How to stop downloading progress in WebClient? Pin
amx_tiger30-Apr-12 6:35
amx_tiger30-Apr-12 6:35 
GeneralRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen30-Apr-12 7:02
professionalEddy Vluggen30-Apr-12 7:02 
GeneralRe: How to stop downloading progress in WebClient? Pin
amx_tiger30-Apr-12 22:19
amx_tiger30-Apr-12 22:19 
GeneralRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen1-May-12 1:02
professionalEddy Vluggen1-May-12 1:02 
QuestionInserting a row into an Access Database with C# Pin
Premisoft29-Apr-12 20:00
Premisoft29-Apr-12 20:00 
AnswerRe: Inserting a row into an Access Database with C# Pin
OriginalGriff29-Apr-12 22:05
mveOriginalGriff29-Apr-12 22:05 
GeneralRe: Inserting a row into an Access Database with C# Pin
Premisoft30-Apr-12 3:48
Premisoft30-Apr-12 3:48 
GeneralRe: Inserting a row into an Access Database with C# Pin
Wes Aday30-Apr-12 5:23
professionalWes Aday30-Apr-12 5:23 
QuestionWinmm.dll for CF Windows CE Pin
baranils29-Apr-12 11:30
baranils29-Apr-12 11:30 
QuestionCollision detection between a circle and rectangle Pin
lethula29-Apr-12 5:46
lethula29-Apr-12 5:46 
AnswerRe: Collision detection between a circle and rectangle Pin
Abhinav S29-Apr-12 16:36
Abhinav S29-Apr-12 16:36 
GeneralRe: Collision detection between a circle and rectangle Pin
lethula30-Apr-12 13:20
lethula30-Apr-12 13:20 
AnswerRe: Collision detection between a circle and rectangle Pin
BobJanova29-Apr-12 23:18
BobJanova29-Apr-12 23:18 
GeneralRe: Collision detection between a circle and rectangle Pin
lethula30-Apr-12 13:27
lethula30-Apr-12 13:27 
GeneralRe: Collision detection between a circle and rectangle Pin
BobJanova30-Apr-12 22:19
BobJanova30-Apr-12 22:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.