NoobieStarter
NoobieStarter

Reputation: 41

Check if a shared folder is password protected in vb.net

I have a shared folder that placed at a computer act as server. When I want to access to this shared folder from another computer that act as client, how can I check if the shared folder I want to access is password protected or not.

Upvotes: 4

Views: 492

Answers (1)

inquisitive
inquisitive

Reputation: 3639

try to access it. if you could then you would. if not then a security-exception will arise. that is the part when you need the password.

this is about windows shared i presume. now windows shares are never password protected. a share is protected through permissions to some user accounts. folder > rt.click > property > security. a dot net code runs from the account of the logged-in user. if the user who is running the code has permissions on the folder as well as on the share then the code is allowed to access it. otherwise a security-exception happens.

Upvotes: 4

Related Questions