string filePath = HttpContext.Current.Server.MapPath(strFile);//路径
FileInfo fileInfo = new FileInfo(filePath);
string ContentType = fileName.Substring(fileName.LastIndexOf("."));
//context.Response.Clear();
//context.Response.ClearContent();
//context.Response.ClearHeaders();
//context.Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
//context.Response.AddHeader("Content-Length", fileInfo.Length.ToString());
//context.Response.AddHeader("Content-Transfer-Encoding", "binary");
context.Response.ContentType = ContentType;
context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
context.Response.WriteFile(fileInfo.FullName);
我使用的是response的writeFile 但是没有效果 代码的没有报错 ~· 求大神们 指点啊