Checking File Permissions

B

blue

Is there a way to check if the currently logged in user has access to a
particular directory or file on the web server?

I've been researching this and have run into suggestions of using P/Invoke
for the native Security API. It should be easier than this. I just want to
check to see if a user can read a directory/file. I don't need to change
the permissions.

Thanks.
 
K

Ken Cox [Microsoft MVP]

Probably the easiest way is to wrap an attempt to read it inside a
Try...Catch...End Try.

If you Catch a security/permissions error, you've got your answer.

You'll want to look at File Access Through BinaryReader and BinaryWriter
Classes in the Help.

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top