471,347 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Is the file on a network share?

Hello group

Is there any way to tell, if a file is on a network share?

I know the path to the file, so I can easily get a FileInfo object, and I
can also use the Path class. However I can't find any way to use this
information to determine if the file is on a local disk, or on a mapped
network drive.

I'm asking, because I'm trying to enumerate all security groups that have
read access to the file. I can do this, but some of the groups can belong to
the build in domains, e.g. BULTIN\Users, and I need to know if this is the
Users group on a local computer, or the Users group on the file server. So
if you can help me do this translation instead, that would be perfect.

Thank you for your help

Regards
Anders
Feb 7 '06 #1
1 1734
Hi,

"Anders K. Olsen" <ak*****@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
Hello group

Is there any way to tell, if a file is on a network share?

I know the path to the file, so I can easily get a FileInfo object, and I
can also use the Path class. However I can't find any way to use this
information to determine if the file is on a local disk, or on a mapped
network drive.


I really don't know if you can do this in managed code, there are two
options that I know of in unmanaged code:

1- Using WMI

2- Using GetDriveType win32 API call

It should be fairly trivial P/invoke it , so I would go that route


--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

23 posts views Thread by Lamberti Fabrizio | last post: by
7 posts views Thread by Frank Rizzo | last post: by
8 posts views Thread by Lam | last post: by
11 posts views Thread by sur | last post: by
7 posts views Thread by Vai2000 | last post: by
reply views Thread by =?Utf-8?B?UGhpbCBKb2huc29u?= | last post: by
reply views Thread by Ronak mishra | last post: by

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.