Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading the content of a file being used by another proc
Message
From
30/12/2004 16:05:39
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00972963
Message ID:
00973405
Views:
18
>I have a function to read the content of a file (a log file) but the file is currently opened by another process... so I get the exception
>"The process cannot access the file because it is being used by another process"
> objFileStream = New FileStream(strPath, FileMode.Open, FileAccess.Read)

Have you tried adding the FileShare parameter?

Example: Dim FS2 As New FileStream(name, FileMode.Open, FileAccess.Read, FileShare.Read)

This would have to be done in the .NET application that originally opens the file.
Christopher Bohling, Consultant
http://www.ChristopherBohling.com
Previous
Reply
Map
View

Click here to load this message in the networking platform