-1
我會嘗試使用此代碼下載文件。但文件大小爲0 KB。什麼是正確和有效的方式來下載文件。使用Windows窗體應用程序下載任何文件與c#
private void DownloadFile()
{
using (WebClient Client = new WebClient())
{
Client.DownloadFileAsync(
new Uri("http://localhost/sn/userSelect.Designer.cs", UriKind.Absolute),
@"C:\xampp\htdocs\sn\test1.txt");
Client.Dispose();
}
}
任何一個可以給我的方法下載了Windows窗體程序的文件在C#.thanks
你看了(HTTP的['爲文檔DownloadFileAsync']:// MSDN。 microsoft.com/en-us/library/ms144196.aspx)? –
特別是,您認爲「異步」部分意味着什麼? –
我將使用兩種方法,例如** DownloadFileAsync **和** DownloadFile **,但結果相同。 :( – Elshan