Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best approach to verify for exclusivity of a file
Message
De
08/08/2011 16:33:06
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
08/08/2011 15:30:00
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01520429
Message ID:
01520443
Vues:
78
This message has been marked as a message which has helped to the initial question of the thread.
>>Sorry for wrong suggestion.
>
>No problem, it seems it is also the same one as Al mentioned. This is exactly the process we are doing. But, before going into a Try Catch, I wanted to verify if there could be a more fancy approach.


You can try to open the file for exclusive read :
Stream stream = File.Open(myfileName, FileMode.Open, FileAccess.read, FileShare.None);
if an error you'll receive an ioexception....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform