关于下载问题
我在asp.net程序中生成txt文本,但是我要用户可以下载,我直接给个连接,就在网页上直接显示了,我要能让他弹出保存,怎么做啊?
------解决方案--------------------fi = new System.IO.FileInfo(strFileName);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
//Response.Charset = "utf-8 ";
//Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.ContentType = ContentType;
Response.AppendHeader( "Content-Disposition ", "attachment;filename= " + fi.Name);
Response.AppendHeader( "Content-Length ", fi.Length.ToString());
Response.WriteFile(fi.FullName);
Response.Flush();
Response.Close();