Environment versions
Network:
Windows 2008 Server
>>>Hello Viv;
>>>
>>>The CM.TXT file is the destinetion file.
>>>
>>>This error happen when all the file have been added.
>>>
>>>Thanks a lot for your time, I really apreciate it....
>>>
>>>Best regards;
>>
>>Do you mean that the error actually happens in some statement *after* the code you show and not within the loop ?
>>If it happens *within* the loop then, by definition, all files would *not* have been added....
>
>unless destination file is within the directory, and if not blockec and using pure file handling instead of a mix of mem / file throws error before or instead of filling the whole HD ;-)))
Yea, if he's reading and writing to the same file, the StreamReader will keep the file open with a read lock causing the error. Switching to File.ReadAllText instead of a StreamReader or reading and writing as separate steps may fix it.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only