Checking File Permissions

Discussion in 'ASP .Net' started by blue, Jul 15, 2004.

  1. blue

    blue Guest

    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.
     
    blue, Jul 15, 2004
    #1
    1. Advertising

  2. 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

    "blue" <> wrote in message
    news:%...
    > 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.
    >
    >
     
    Ken Cox [Microsoft MVP], Jul 15, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Allen
    Replies:
    0
    Views:
    440
    Scott Allen
    Jul 13, 2004
  2. Anoop

    Checking File permissions

    Anoop, Jul 20, 2006, in forum: Python
    Replies:
    2
    Views:
    333
    Tal Einat
    Jul 21, 2006
  3. Anoop

    Checking File permissions

    Anoop, Jul 20, 2006, in forum: Python
    Replies:
    1
    Views:
    277
    Lawrence D'Oliveiro
    Jul 21, 2006
  4. Anoop

    Checking File permissions

    Anoop, Jul 20, 2006, in forum: Python
    Replies:
    1
    Views:
    288
    Larry Bates
    Jul 20, 2006
  5. David K. Wall

    checking effective file permissions

    David K. Wall, Aug 9, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    109
    Glenn Jackman
    Aug 10, 2004
Loading...

Share This Page