none
Reading a file/folder permission on network using VB.net

    Question

  • Can anyone teach me on how you can allow vb.net to access a file/folder within a domain group and retrieves it permission setting to determine if the user have access or denied access to a certain folder?

    thank you

    Monday, August 01, 2011 3:28 AM

All replies

  • You may want to check the FileAccess Enumeration and FileIOPermisson Class.

    http://msdn.microsoft.com/en-us/library/4z36sx0f.aspx

    http://msdn.microsoft.com/en-us/library/system.security.permissions.fileiopermission.aspx

    To check whether the user has the access to a certain folder, a simple way is to create a new file with System.IO.File within a try/catch statement, if no exceptions pop up, that means the user does have the permission.

    Best Regards,


    Kee Poppy [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 03, 2011 8:23 AM
  • Hi there,

     

    I try to map to the network drives and i am able to read the number of folders in the drives and access right for FULL CONTROL ( READ , write etc. ) is given to me and in fact "everyone in the same domain group that i am in. However i encounter the following code error where 

     

    FileOpen(1, ReadString, OpenMode.Binary)   --> It prompts that access to the path of \\xxxxxxxxx\folder\ is denied.

     

        I am able to retrieve all the folders but when it starts to open the                      binary files it start to give the runtime exception of access denied.  Can    anyone help me in detailed explaination? 

     

    Thank you

    Monday, August 22, 2011 6:32 AM