Checking File Permissions

  • Thread starter Thread starter blue
  • Start date Start date
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.
 
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
 
Back
Top