0
得到錯誤「的部分或全部身份引用不能轉換設置文件夾訪問時出錯?
獲得在第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)
你能否進一步解釋你有什麼問題?告訴我們這是在第八行是沒有太大的起飛。你有沒有設置斷點? – Codexer