0
我試圖從我的Web服務下載文件(.txt)。我的網絡服務使用此代碼C#ASPX從本地主機下載文件
WebClient req = new WebClient();
HttpResponse Response = HttpContext.Current.Response;
Response.ContentType = "image/jpeg";
Response.AddHeader("Content-Disposition", "attachment;filename=" +
fileName);
Response.WriteFile("C:\\Temp\\Storage\\" + (fileName));
Response.End();
我想從客戶端調用它。這是如何完成的?
您是否嘗試過使用[WebClient.DownloadFile()](http://msdn.microsoft.com/en-us/ library/ez801hhe.aspx)方法,如果是這樣,問題是什麼? – 2013-02-15 10:05:59