Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The process cannot access the file
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01351711
Message ID:
01351759
Vues:
18
>>In a CRC32() class, I need to read a file by the use of FileStream() in such an approach:
>>
>>
>>        ' This is the main method to call
>>        Public Function GetCRC() As Boolean
>>            Dim loStream As Stream
>>            loStream = New FileStream(cFileName, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
>>            nCRC32 = GetCrc32(loStream)
>>            loStream.Close()
>>            Return True
>>        End Function
>>
You could also set the FileShare to ReadWrite. I'm not sure if it will help in this case, but it will allow other processes to be able to open it as well.
loStream = New FileStream(cFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 8192)
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform