出现错误“无法翻译部分或全部身份参考
在第 8 行出现错误
Dim FolderPath As String = "D:\Account\HA\" 'Specify the folder here
Dim UserAccount As String = mailid.ToString() & "\" & pwd
Dim objDirectoryInfo As DirectoryInfo = Nothing
Dim objDirectorySecurity As DirectorySecurity = Nothing
Dim objRule As FileSystemAccessRule = Nothing
objDirectoryInfo = New DirectoryInfo(FolderPath)
objDirectorySecurity = objDirectoryInfo.GetAccessControl
objRule = New FileSystemAccessRule(UserAccount, FileSystemRights.ReadPermissions, AccessControlType.Allow)
objDirectorySecurity.AddAccessRule(objRule)
objDirectoryInfo.SetAccessControl(objDirectorySecurity)