随笔分类 - 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...
阅读全文
摘要://流文件下载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,
阅读全文