Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TXT file doesn´t close
Message
De
22/10/2015 12:11:10
 
 
À
22/10/2015 11:39:30
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01626227
Message ID:
01626343
Vues:
34
>>>>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.


Or a simple if clause skipping the destination file from the reading process ;-))
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform