Archives For .net

Using .NET you may think that determining which permissions are assigned to a directory/file should be quite easy, as there is a FileSystemRights Enum defined that seems to contain every possible permission that a file/directory can have and calling AccessRule.FileSystemRights returns a combination of these values. However, you will soon come across some permissions where the value in this property does not match any of the values in the FileSystemRights Enum.

Continue Reading…

Just thought I would post about this quickly as its an error message that I ran into recently that took me quite a while to figure out. So to save other .NET developers spending ages trying to work out why it was happening like I did, I’ll explain how you can get rid of this rather annoying problem.

Continue Reading…

As mentioned in my previous post I have been working on figuring out how to set share permissions (not NTFS permissions) from a VB.NET app for the last couple of days… and I have finally got it working. This code makes use of the NetShareAdd Windows API along with several others to create the share and the ACL to go with it that specifies the permissions. Note that this can also be run against remote computers to create shares on them as well.

Continue Reading…