Fry
Fry

Reputation: 4286

How do you check if a folder is accessible over a network in c#

I need to know if a folder is accessible to other computers on the network, so the first part of this is checking if the folder is shared accross the network. As the folder I'm checking may be a sub-folder, I can't just iterate across shared folders on the computer to check if one of them points to my folder unless WMI allows me to check this?

Ideas?

I guess I should specify a bit more, I don't need to know if this is a shared folder, I need to know if this folder is shared. I.e. More than likely, this folder itself will not be a "shared folder" but will be a subdirectory under a shared folder.

Upvotes: 0

Views: 3422

Answers (1)

wprl
wprl

Reputation: 25407

This MSDN article explains how. Just check to see if the folder's name appears in the list of shared folders returned in the example.

Upvotes: 1

Related Questions