473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to check if a file is used by another user

Hi

I'd like know how to check a file is used by another user

Thank

Nov 20 '05 #1
17 3090
Hi
Check FileInfo.Open Method.

Kind Regards
Jorge
-----Original Message-----
Hi,

I'd like know how to check a file is used by another user.
Thanks

.

Nov 20 '05 #2
Hi
Check FileInfo.Open Method.

Kind Regards
Jorge
-----Original Message-----
Hi,

I'd like know how to check a file is used by another user.
Thanks

.

Nov 20 '05 #3
Li,

Look at the File class, specifically the FileShare enumeration.
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemiofileclasstopic.asp

HTH,

Raymond Lewallen

"Li Pang" <an*******@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
Hi,

I'd like know how to check a file is used by another user.

Thanks

Nov 20 '05 #4
Li,

Look at the File class, specifically the FileShare enumeration.
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemiofileclasstopic.asp

HTH,

Raymond Lewallen

"Li Pang" <an*******@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
Hi,

I'd like know how to check a file is used by another user.

Thanks

Nov 20 '05 #5
Li, I didn't give you the correct information. I was thinking about
something else (I'm doing that alot lately :| ) I actually don't know how
to do what you are looking for. You might try the FileIOPermission class,
or start there anyways.

Raymond Lewallen

"Li Pang" <an*******@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
Hi,

I'd like know how to check a file is used by another user.

Thanks

Nov 20 '05 #6
Li, I didn't give you the correct information. I was thinking about
something else (I'm doing that alot lately :| ) I actually don't know how
to do what you are looking for. You might try the FileIOPermission class,
or start there anyways.

Raymond Lewallen

"Li Pang" <an*******@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
Hi,

I'd like know how to check a file is used by another user.

Thanks

Nov 20 '05 #7
Hi Li

When you go to the newsgroup

microsoft.public.dotnet.general

to the thread "ridiculous" it is on the top when you start at todays threads

There is discussion and also information about your question.

Cor
Nov 20 '05 #8
Hi Li

When you go to the newsgroup

microsoft.public.dotnet.general

to the thread "ridiculous" it is on the top when you start at todays threads

There is discussion and also information about your question.

Cor
Nov 20 '05 #9
"Li Pang" <an*******@discussions.microsoft.com> schrieb

I'd like know how to check a file is used by another user.


I think there is no way to check it. You can try to open it using the needed
access permission. If it fails, the file is locked.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #10
"Li Pang" <an*******@discussions.microsoft.com> schrieb

I'd like know how to check a file is used by another user.


I think there is no way to check it. You can try to open it using the needed
access permission. If it fails, the file is locked.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #11
RDI
Or NOT FOUND.
"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
"Li Pang" <an*******@discussions.microsoft.com> schrieb

I'd like know how to check a file is used by another user.
I think there is no way to check it. You can try to open it using the

needed access permission. If it fails, the file is locked.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #12
RDI
Or NOT FOUND.
"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
"Li Pang" <an*******@discussions.microsoft.com> schrieb

I'd like know how to check a file is used by another user.
I think there is no way to check it. You can try to open it using the

needed access permission. If it fails, the file is locked.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #13
RDI
Or READ ONLY or in a READ ONLY directory--if on a network, this is VERY
possible.
"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
"Li Pang" <an*******@discussions.microsoft.com> schrieb

I'd like know how to check a file is used by another user.
I think there is no way to check it. You can try to open it using the

needed access permission. If it fails, the file is locked.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #14
RDI
Or READ ONLY or in a READ ONLY directory--if on a network, this is VERY
possible.
"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
"Li Pang" <an*******@discussions.microsoft.com> schrieb

I'd like know how to check a file is used by another user.
I think there is no way to check it. You can try to open it using the

needed access permission. If it fails, the file is locked.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #15
"RDI" <RD*@IHateSpam.com> schrieb
Or READ ONLY or in a READ ONLY directory--if on a network, this is
VERY possible.


I didn't say that only this error can occur. It is obvious that he/she has
to check /which/ exception was thrown.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #16
"RDI" <RD*@IHateSpam.com> schrieb
Or READ ONLY or in a READ ONLY directory--if on a network, this is
VERY possible.


I didn't say that only this error can occur. It is obvious that he/she has
to check /which/ exception was thrown.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #17
One solution may be to check the timestamp of the file. If it's changed then it can be considered as available again.
Nov 20 '05 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
6
by: joethis | last post by:
Is there a way to make sure that a file is already in use using asp? For instance, if one person has opened a file and is about to write to it; then is there a way to keep another user from...
4
by: eight02645999 | last post by:
hi i created a login page that authenticate the user and his/her password to the unix ssystem. what modules can i used to compare the unix password with what the user typed in the cgi form? the...
2
by: Chris Windsor | last post by:
I hope the following describe what I'm trying to do: I have created a tool to be used by product analysts when studying different cell phone designs. Part of the tool is a set of 11 forms on a...
4
by: Jared | last post by:
Radio Button or Check Box and Event Procedures I need to insert either radio buttons or check boxes onto my form. I'm not sure which to use, or if there are other options. I am using the buttons...
16
by: Li Pang | last post by:
Hi I'd like know how to check a file is used by another user Thank
9
by: webrod | last post by:
Hi all, how can I check a user/password in a LDAP ? I don't want to connect with this user, I would like to connect to LDAP with a ADMIN_LOG/ADMIN_PWD, then do a query to find the user and...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.