//上传:用个FileUpload1控键string sFileName;sFileName = FileUpload1.FileName;string sFilePath = Server.MapPath("File");string strPath = System.IO.Path.Combine(sFilePath, FileUpload1.FileName);FileUpload1.PostedFile.SaveAs(strPath);//下载:string filepath = Server.MapPath("File");string filename = //下载文件名;string path = filepath + filename;Response.Clear();Response.ContentType = "application/octet-stream";Response.AddHeader("Content-Disposition", "attachment;FileName=" + HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8));Response.WriteFile(path);Response.End(); 来源:https://www.cnblogs.com/gjahead/archive/2006/06/23/433908.html 标签 string response