1
如何強制下載服務器上文本文件的對話框?如何強制在服務器上爲文本文件下載對話框?
當我用一擊代碼,這樣的對話窗口是爲aspx文件......(爲什麼?)
string FileBankPhysicalFolder = Server.MapPath("~/FileBanks/");
string Name = "FileBank_" + "Melli_" + Session["Co_ID"].ToString() + "_" + RadcbDateOfPardakht.SelectedValue.Replace('/',',') + ".txt";
string FileBankPath = FileBankPhysicalFolder + Name;
string Content = Header + Body;
System.IO.File.WriteAllText(FileBankPath, Content);
Response.ContentType = "text/plain";
Response.AppendHeader("Content-Disposition", "attachment;" + Name);
Response.WriteFile(FileBankPath);
Response.End();
我怎樣才能解決這個問題?
非常感謝... – LostLord 2010-10-09 16:01:47
不客氣的朋友:) – Claudiu 2010-10-09 16:06:43