java 文件流问题,文件流创建问题

我在sharepoint服务器上运行代码,这令我头疼 . 问题在于Filstream.create会抛出此异常

System.IO上的异常.__ . Error.WinIOError(Int32 errorCode,String maybeFullPath)在System.IO.FileStream.Init(字符串路径,FileMode模式,FileAccess访问,Int32权限,布尔useRights,FileShare共享,Int32 bufferSize,FileOptions选项,SECURITY_ATTRIBUTES secAttrs,String msgPath,Boolean bFromProxy,Boolean useLongPath,Boolean checkHost)at System.IO.FileStream..ctor(String path,FileMode mode,FileAccess access,FileShare share,Int32 bufferSize,FileOptions options,String msgPath,Boolean bFromProxy)at System .IO.FileStream..ctor(String path,FileMode mode)at

抛出异常的代码块是

using (FileStream fs = new FileStream(TargetPath, FileMode.Create))

{

BinaryReader bReader = new BinaryReader(readStream);

BinaryWriter bWriter = new BinaryWriter(fs);

int allBytes = (int)readStream.Length;

bWriter.Write(bReader.ReadBytes(allBytes));

//bReader.Close();

//bWriter.Close();

}

有没有人有一个想法,关于如何去做?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值