IOException:進程無法訪問文件“文件路徑”,因為它正被另一個進程使用我有一些代碼,當它執(zhí)行時,它會拋出一個IOException說進程無法訪問文件“文件名”,因為它正被其他進程使用。這意味著什么,我能做些什么?
3 回答

米脂
TA貢獻1836條經驗 獲得超3個贊
using (var stream = File.Open(path, FileMode.Open, FileAccess.Write, FileShare.ReadWrite)){}

LEATH
TA貢獻1936條經驗 獲得超7個贊
//C# .NETvar image = Image.FromFile(filePath);image.Dispose(); // this removes all resources//later...File.Delete(filePath); //now works
- 3 回答
- 0 關注
- 1207 瀏覽
添加回答
舉報
0/150
提交
取消