您的位置:首页 > 编程语言 > C#

C#使用Create创建文件后,报The Process cannot access the file because it is being used by another process的异常

2010-09-27 15:09 736 查看
今天使用File.Create("dddd.txt");后,打开这个文件时报The Process cannot access the file because it is being used by another process的异常。在网上找到解决方法如下:

File.Create("dddd").Close();

如果不Close(),那么这个文件一直被创建进程占着,直到创建进程被关闭。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐