Webserver-File Download und Upload synchron und asynchron

using System.Net;

// Download synchron
WebClient wc = new WebClient();
// von http://www.seite.de/Datei.txt eine Datei laden
// und in c:\\Datei.txt speichern
wc.DownloadFile("http://www.seite.de/Datei.txt", "c:\\Datei.txt");

oder

WebClient wc = new WebClient ();
Stream strm = wc.OpenRead ("http://www.seite.de/Datei.txt");
StreamReader sr = new StreamReader(strm);

string line;
do
{
    line = sr.ReadLine();
    listbox1.Items.Add(line);
}
while (line !=null);

strm.Close();

// Download asynchron
WebClient wc = new WebClient();
wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(updateProgress);
wc.DownloadFileAsync("http://www.seite.de/Datei.txt", "c:\\Datei.txt");
// Eventhandler für DownloadProgressChanged
private void updateProgress(object sender, DownloadProgressChangedEventArgs Arg)
{
    progressBar.Value = Arg.ProgressPercentage;
}

// Upload
WebClient wc = new WebClient();
wc.UploadFile("http://www.seite.de/Datei.txt", "c:\\Datei.txt");