随笔分类 -  ASP.NET文件下载

摘要:/// /// 将图片从数据库中读取 /// /// 要读取图片的学号 /// pictureBox1控件名 public void get_photo(string xs_ID, PictureBox ph)//将图片从数据库中读取 { byte[] imagebytes = null; getcon(); SqlCommand con = new SqlCommand("select * from S_jiben wher... 阅读全文
posted @ 2013-12-06 13:02 简单就好。。。 阅读(396) 评论(0) 推荐(0) 编辑
摘要://流文件下载protectedvoid Download1_Click(objectsender,EventArgse){stringfileName="CodeShark.zip";//客户端保存的文件名stringfilePath=Server.MapPath("DownLoad/CodeShark.zip");//路径//以字符流的形式下载文件FileStreamfs=newFileStream(filePath,FileMode.Open);byte[]bytes=newbyte[(int)fs.Length];fs.Read(bytes,0, 阅读全文
posted @ 2013-12-06 11:10 简单就好。。。 阅读(152) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示