将图片文件以byte的形式从导数据库中

时间:2014-05-14 08:24:40   收藏:0   阅读:394

 byte[] FileByteArray = new byte[FileLength];  //图象文件临时储存Byte数组
                //Stream StreamObject = UpFile.InputStream;             //建立数据流对像  

                /////读取图象文件数据,FileByteArray为数据储存体,0为数据指针位置、FileLnegth为数据长度  
                //StreamObject.Read(FileByteArray, 0, FileLength);
                //StreamObject = null;
                FileStream fs = new FileStream(FullFilePath, FileMode.OpenOrCreate);
                BinaryReader rs = new BinaryReader(fs);
                FileByteArray = rs.ReadBytes(Convert.ToInt32(fs.Length));
                rs.Close();
                rs = null;
                fs.Close();
                fs = null;

                theNewFile.CONTENT = FileByteArray;

将图片文件以byte的形式从导数据库中,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!