/// <summary>
        /// 把数据库二进制图片转存到硬盘中
        /// Save the picture at hard disk by binary data
        /// </summary>
        /// <param name="byt">Binary data for picture</param>
        /// <param name="fileName">File name of picture include full path</param>
public static void SavePicByBinary(byte[] byt, string fileName)
{
    try
    {
        FileStream fs = new FileStream(@fileName, FileMode.Create, FileAccess.Write);
        //使用从缓冲区读取的数据将字节块写入该流。
        fs.Write(byt, o, byt.Length);    
        fs.Flush();
        fs.Close();
    }
    catch (Exception ex)
    {
        throw ex;
    }
}

 

posted on 2013-02-01 14:36  风扬剪影  阅读(380)  评论(0编辑  收藏  举报