继续发帖求教:用C#实现文件下载时,没反应,点击左下角图标显示乱码。
「已注销」 2013-09-15 05:10:10 下载代码如下(这段代码是没问题的):
string filePath = DownFiletbl.Rows[e.NewEditIndex].Cells[9].Text;
int intStart = filePath.LastIndexOf("\\") + 1;
string saveFileName = filePath.Substring(intStart, filePath.Length - intStart);
string FileType = "text/html";
Response.Clear();
Response.Buffer = true;
Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(saveFileName, Encoding.UTF8).ToString());
Response.ContentType = FileType;
Response.WriteFile(filePath);
Response.Flush();
Response.Close();
Response.End();
运行后,下载界面没弹出,点左下角提示如下:
行:709
字符:17
错误:Sys.ArgumentException:..一串乱码
代码:0
URL:...
不知道我的页面中哪里有错造成的,第一次写网页程序,调试太麻烦了,求大侠指点,谢谢