将数据库二进制文件读出并保存到磁盘上

//主要适用FileStream类,如下
private void WriteToFile(string strPath, ref byte[] Buffer)
{
    // Create a file
    FileStream newFile = new FileStream(strPath, FileMode.Create);

     // Write data to the file
    newFile.Write(Buffer, 0, Buffer.Length);

    // Close file
    newFile.Close();
}


当然,如果是适用file控件,可以添加如下代码
 fl_upload.PostedFile

posted @ 2007-11-12 09:12  启明星工作室  阅读(1041)  评论(0编辑  收藏  举报