我的数据库中有个字段的类型是Image的,我想保存Word文档,我插入的时候没有错误,可是我读的时候怎么读出来的都是空文档,是不是我插入的代码有问题,我觉得好象没有问题啊?
我的代码是这样的:public byte[] GetDocu(string filepath)
{
System.IO.FileStream fs=new FileStream(filepath,System.IO.FileMode.Open,System.IO.FileAccess.Read);
System.IO.BinaryReader br=new BinaryReader(fs);
byte[] docu=br.ReadBytes((int)fs.Length);
br.Close();
fs.Close();
return docu;
}//filepath:文件的路径
我的目的是要获取该文件的byte[],大家看看这个有问题吗?
我的代码是这样的:public byte[] GetDocu(string filepath)
{
System.IO.FileStream fs=new FileStream(filepath,System.IO.FileMode.Open,System.IO.FileAccess.Read);
System.IO.BinaryReader br=new BinaryReader(fs);
byte[] docu=br.ReadBytes((int)fs.Length);
br.Close();
fs.Close();
return docu;
}//filepath:文件的路径
我的目的是要获取该文件的byte[],大家看看这个有问题吗?
解决方案 »
- ASP.NET后台 存不确定个数的控件的值
- ObjectDataSource问题?
- ASP.NET 2.0 Profile谁使用过啊
- .net(c#)页面代码中如何用javascript将后台数组传到前台
- <html>、<title>、<head...")中检测到有潜在危险的 Request.Form 值
- 关于vs2008 安装后 iis 的问题
- 大家來看下是不是ASP.NET的BUG,我的代碼竟然沒解釋出來
- 急急急!!!
- 蛙蛙请教:他们怎么做到静态文件的限制访问的呀?
- 在Datagrid中怎样修改url format string?
- 什么是ASP.NET 2.0 ???
- 如何实现不刷新添加数据
,怎么可能是同样的记录呢?
word,老是不成功,怪事!