What exception is thrown in the .NET Framework when trying to write a file but the disk is full?
Does Windows buffer file writes?
您将获得IO异常:
System.IO.IOException: There is not enough space on the disk.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
Run Code Online (Sandbox Code Playgroud)
该System.IO库处理读取和写入磁盘的实际任务,并将它们包装在托管代码中,因此您不应使用它们获取任何非托管异常.
它也值得尝试(使用其中一个粗制的小型USB棒,它们随处可见)来查看代码会发生什么 - 这通常是找到这种东西的最佳方式.
| 归档时间: |
|
| 查看次数: |
3379 次 |
| 最近记录: |