473,503 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3099
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
7085
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
4720
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
3452
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
1574
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
11022
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
237
by: Li Pang | last post by:
Hi I'd like know how to check a file is used by another user Thank
9
15479
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
7646
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
7192
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
7064
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
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6974
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
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4991
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...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.