Versions des environnements
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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement