473,394 Members | 1,722 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,394 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 3092
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.