473,405 Members | 2,185 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,405 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 3093
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.