单击一个LinkButton下载东西的代码谁有,谢谢

来源:百度知道 编辑:UC知道 时间:2024/06/06 01:35:03

string path = AppDomain.CurrentDomain.BaseDirectory + @"Templates\assignee list.xls";//文件存放路径
FileInfo file = new FileInfo(path);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();

下什么东西啊~~说清楚撒~~