我有一个应用程序,它将 1000 个文件从一个文件夹复制到另一个文件夹。复制每个文件后,我们会将复制成功/失败信息写入单独的文件中。有时,在将这个副本信息写入文件的过程中,StreamWriter,WriteLine 会抛出以下异常”
10/28/2014 12.21.02.068 Message : Not enough storage is available to process this command.
Filename : Copying file C:\Program Files\XYZ\SampleFile.xml to C:\Program
Files\ABC\SampleFile.xml.xml | Inner Exception : | Type : System.IO.IOException | Source : mscorlib
Not enough storage is available to process this command.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__ConsoleStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.WriteLine(String value)
at System.IO.TextWriter.SyncTextWriter.WriteLine(String value)
at System.Console.WriteLine(String value)
at VersionActivator.VersionActivationController.LogMessage(String message)
mscorlib : Not enough storage is available to process this command.**
但是,当 PC 在安全模式下初始化时,此应用程序可以正常工作。
谁能帮帮我吗?