码迷,mamicode.com
首页 > Windows程序 > 详细

C#文件处理File.Create(FilePath)相关报错

时间:2017-12-13 20:08:26      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:创建   span   方法   not   xxxx   size   nbsp   str   post   

C#使用File.Create(FilePath)创建文件后,再次处理该文件报错。怎么解决?

 
报错xxxxxxxx...because it is being used by another process.

解决方法:
File.Create(FilePath).Close();
创建完后关闭文件即可。

C#文件处理File.Create(FilePath)相关报错

标签:创建   span   方法   not   xxxx   size   nbsp   str   post   

原文地址:http://www.cnblogs.com/watermarks/p/8034048.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!