1.通過byte[]數據下載文件
FileDownLoadByByte([] fileData, = = , +
LoadFileFromServer( fileName, = , +, = = System.Text.Encoding.GetEncoding(
②
= , filename = Server.MapPath(
3.通過流的形式下載文件
fileName = ; filePath = Server.MapPath( FileStream fs = [] bytes = [(= Response.AddHeader(, +
4.Excel下載
http://www.cnblogs.com/TiestoRay/archive/2013/02/02/2576134.html
5.如果是用的.NET MVC3(及以上) 一切變得更加簡單
例如
filePath = Server.MapPath( File(filePath, ,
它共有六種可用形式
FileContentResult File([] fileContents, fileName, FileContentResult File([] fileContents, contentType, FileStreamResult File(Stream fileStream, contentType, FilePathResult File( fileName, contentType, fileDownloadName);
6.讀取ftp文件到字符串中
= = ftp += (FtpWebRequest)FtpWebRequest.Create(= = = reqFTP.Method?=?== line = (line != =),