写入新创建的路径时出错 [英] error writing to a newly created path

查看:93
本文介绍了写入新创建的路径时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在目录中创建一个目录和一个文件。当我尝试将

写入文件时,我收到以下错误:

无法访问该文件...因为它正被另一个进程使用。


目录和文件创建得很好 - 事实上,我可以重新启动

程序,因为路径已经创建,我可以写文件

没问题。我只有在第一次创建路径时才会收到错误

然后我会尝试写入文件。

感谢任何帮助!

I''m creating a directory and a file in the directory. When I try to write
to the file I get the following error:
"Can not access the file ... because it is being used by another process".

The directory and file are created just fine - in fact, I can restart the
program and since the path has already been created, I can write to the file
with no problem. I only get the error when I have to first create the path
and then I try to write to the file.
Any help is appreciated!

推荐答案

请发布一些代码。可能你用来创建

文件的方法没有释放锁定。


Eddie Suey < ES *** @ inBizServices.com>在消息中写道

news:u6 ************** @ TK2MSFTNGP09.phx.gbl ...
Post some code please. Its possible that the method you used to create the
file hasn''t released its lock.

"Eddie Suey" <es***@inBizServices.com> wrote in message
news:u6**************@TK2MSFTNGP09.phx.gbl...
我正在创建目录和目录中的文件。当我尝试写入文件时,我收到以下错误:
无法访问该文件...因为它正被另一个进程使用。

目录和文件创建得很好 - 事实上,我可以重新启动
程序,因为路径已经创建,我可以写入
文件没有问题。当我必须首先创建
路径然后我尝试写入文件时,我才会收到错误。
感谢任何帮助!
I''m creating a directory and a file in the directory. When I try to write
to the file I get the following error:
"Can not access the file ... because it is being used by another process".

The directory and file are created just fine - in fact, I can restart the
program and since the path has already been created, I can write to the file with no problem. I only get the error when I have to first create the path and then I try to write to the file.
Any help is appreciated!



嗨Eddie,


如何创建路径


请先输入一段代码,现在你可以从这里一英里获得一百万个答案和一个线程

,其中一个可能正确。


Cor
Hi Eddie,

How do you create the path

Please a piece of code first, now you can get a million answers and a thread
from a mile here and one of them can maybe right.

Cor


*Eddie Suey < ES *** @ inBizServices.com> scripsit:
* "Eddie Suey" <es***@inBizServices.com> scripsit:
我正在目录中创建一个目录和一个文件。当我尝试写入文件时,我收到以下错误:
无法访问该文件...因为它正被另一个进程使用。

目录和文件创建得很好 - 事实上,我可以重新启动
程序,因为路径已经创建,我可以写入文件
没有问题。我只有在第一次创建路径时才会收到错误
然后我会尝试写入文件。
I''m creating a directory and a file in the directory. When I try to write
to the file I get the following error:
"Can not access the file ... because it is being used by another process".

The directory and file are created just fine - in fact, I can restart the
program and since the path has already been created, I can write to the file
with no problem. I only get the error when I have to first create the path
and then I try to write to the file.




发布用于创建的代码文件。


-

Herfried K. Wagner

MVP·VB Classic,VB.NET

< http://www.mvps.org/dotnet>



Post the code you use to create the file.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>


这篇关于写入新创建的路径时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆