1
限制對特定用戶的文件夾訪問。使用vb.net。在一個變量傳遞用戶名和密碼。但在這行我得到錯誤,如在above.the變量mailid提到和pwd包含類似XX一定的價值和YY從字符串到類型long的轉換在vb.net中無效錯誤
code
----
Dim FolderPath As String = "D:\ABC\2011\TAccount\HA\" 'Specify the folder here
Dim UserAccount As String = mailid \ pwd
Dim FolderInfo As IO.DirectoryInfo = New IO.DirectoryInfo(FolderPath)
Dim FolderAcl As New DirectorySecurity
FolderAcl.AddAccessRule(New FileSystemAccessRule(UserAccount, FileSystemRights.FullControl, InheritanceFlags.ContainerInherit Or InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Deny))
FolderInfo.SetAccessControl(FolderAcl)