1

使用 vb.net 设置文件夹权限。但是我在我的代码中遇到了上面提到的错误。这里我附上了代码。有人帮我解决该特定行中的错误吗?

Dim FolderPath As String = "D:\Account\HA\" 'Specify the folder here                 
Dim UserAccount As String = mailid.ToString() & "\" & pwd
Dim FolderInfo As IO.DirectoryInfo = New IO.DirectoryInfo(FolderPath)
Dim FolderAcl As New DirectorySecurity
FolderAcl.AddAccessRule(New FileSystemAccessRule(UserAccount, FileSystemRights.FullControl, AccessControlType.Deny))            
FolderInfo.SetAccessControl(FolderAcl

在第 5 行出现错误。

4

0 回答 0