日期:2014-05-18  浏览次数:20900 次

C# 读取并下载文件时(是用txt文件试的),把页面源文件内容也写到文件里了,请问这是怎么回事?
开头是这么写的,请问源文件也写到文件里了跟这块儿有关系吗? 谢谢!

System.IO.Stream iStream = new System.IO.FileStream(filePath, System.IO.FileMode.Open, 
  System.IO.FileAccess.Read, System.IO.FileShare.Read);
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename="+fileName);

------解决方案--------------------
是你的Response把网页源码也请求下来了