小编ril*_*il2的帖子

为什么我得到:“该进程无法访问该文件,因为它正在被另一个进程使用”

我使用 C# 尝试了以下操作:

File.CreateText("x.y");
folderBrowserDialog1.ShowDialog();
string dir = folderBrowserDialog1.SelectedPath.ToString();
File.WriteAllText("x.y", dir);
Run Code Online (Sandbox Code Playgroud)

但是当我运行该程序时,它说该进程无法访问该文件(xy),因为它正在被另一个进程使用。

[在file.WriteAllText]

提前致谢。

c# file process createfile

0
推荐指数
1
解决办法
3236
查看次数

标签 统计

c# ×1

createfile ×1

file ×1

process ×1