[ATTACH=CONFIG]451[/ATTACH]
سورس:
[CSHARP]using System;
using System.ComponentModel;
using System.Windows.Forms;
using System.Net;
using System.IO;
namespace WindowsFormsApplication3
{//this project downloaded from http://softafzar.net
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SaveFileDialog SFD = new SaveFileDialog();
SFD.FileName = Path.GetFileName(txtURL.Text);
SFD.ShowDialog();
WebClient webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
webClient.DownloadFileAsync(new Uri(txtURL.Text), SFD.FileName);
}
private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
progress.Value = e.ProgressPercentage;
}
private void Completed(object sender, AsyncCompletedEventArgs e)
{
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("http://softafzar.net");
}
}
}[/CSHARP]
پروژه هم ضمیمه شد.
موفق باشید.