protected void LinkButton1_Click(object sender, EventArgs e) { string url = @"D://Error.txt"; // Create an instance of WebClient WebClient client = new WebClient(); // Hookup DownloadFileCompleted Event client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted); // Start the download and copy the file to c:\temp client.DownloadFileAsync(new Uri(url), @"E:\Error.txt"); } void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { Response.Write("File downloaded"); }
WebClient
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)