using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
namespace webclient
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
WebClient wc = new WebClient();
private void button1_Click(object sender, EventArgs e)
{
Uri uri=new Uri("http://www.quack-ware.com/images/logo.jpg");
//wc.DownloadFileCompleted += new AsyncCompletedEventHandler(wc_DownloadFileCompleted);
int i = 0;
while (i < 20)
{
// wc.DownloadFileAsync(uri, "abc.jpg"+i.ToString());
wc.DownloadFile(uri, "ax.jpg" + i.ToString());
i++;
}
}
/* void wc_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
MessageBox.Show("done");
}
*/
}
}
|