摘要:
流方式下载View Code 1 //string fileName = "file/s.txt"; //定义文件的路径 2 //string filePath = Server.MapPath(fileName); //将指定的虚拟路径转换成物理路径 3 ////以字符流的形式下载文件 4 //FileStream fs = new FileStream(filePath,FileMode.Open); 5 //byte[] bt = new byte[(int)fs.Length]; 6 //fs.Read(bt,0,bt.Length); 7 //fs.Close()
阅读全文