tags:

views:

39

answers:

1

Dear all,

I have a excel file place on server.

I am using a application which written by VB.NET to open file in read only mode.

User 1 open file in read only mode. How can user 2 detect that file is open or not status?

Thanks, An

+1  A: 

The second user can try to open the file in read-write mode to know if the file is being used.

M.A. Hanin
Doesn't sound optimal but its true. Even if you had some way to detect for the lock its possible that between your lock check and actually opening the file someone could open the file so the best bet is to just try opening the file and catch the exception if there is one.
Chris Haas