关于写文件下载的问题
小弟菜鸟,我想写一个文件下载的程序,现在功能已经实习,代码如下int index = Convert.ToInt32();//取得当前行
FileInfo downLoadFile = new FileInfo(GridView1.Rows[index].Cells[1].Text);
Response.ContentType = "application/octet-stream";
string fileName = HttpUtility.UrlEncode(GridView1.Rows[index].Cells[0].Text, System.Text.Encoding.UTF8);//防止中文名称时的乱码
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
Response.AppendHeader("Content-length", downLoadFile.Length.ToString());
Response.WriteFile(downLoadFile.FullName);
Response.Flush();
Response.End();
但是对Response的AddHeader不是太了解,望高手指教