設(shè)置權(quán)限的方法:
發(fā)展壯大離不開廣大客戶長期以來的信賴與支持,我們將始終秉承“誠信為本、服務(wù)至上”的服務(wù)理念,堅持“二合一”的優(yōu)良服務(wù)模式,真誠服務(wù)每家企業(yè),認真做好每個細節(jié),不斷完善自我,成就企業(yè),實現(xiàn)共贏。行業(yè)涉及護欄打樁機等,在成都網(wǎng)站建設(shè)、營銷型網(wǎng)站建設(shè)、WAP手機網(wǎng)站、VI設(shè)計、軟件開發(fā)等項目上具有豐富的設(shè)計經(jīng)驗。
1、隨意的到電腦中選擇一個文件夾,點擊右鍵,選擇屬性選項。
2、在彈出來的屬性窗口中切換到安全這一欄,然后選擇最下方的高級。
3、在高級設(shè)置窗口中,咱們選擇所有者,然后點擊編輯,最后是確定。
4、在名稱這一欄中選擇所有者,然后將下方的“替換子容器和對象的所有者”勾選上,最后確定退出設(shè)置窗口。
5、選擇當前所有者即可。
不建議用在應(yīng)用程序中操作共享文件或共享文件夾,這個東西往往會把軟件做得過于死板。
'
' 需要添加以下命名空間:
' Imports System.IO
' Imports System.Security.AccessControl
' */
Dim sPath As String = Server.MapPath(文件夾名稱字符串)
Directory.CreateDirectory(sPath)
addpathPower(sPath, "ASPNET", "FullControl")
'////////////////////////////////////////////////
Public Sub addpathPower(ByVal pathname As String, ByVal username As String, ByVal power As String)
Dim dirinfo As DirectoryInfo = New DirectoryInfo(pathname)
If (dirinfo.Attributes FileAttributes.ReadOnly) 0 Then
dirinfo.Attributes = FileAttributes.Normal
End If
'取得訪問控制列表
Dim dirsecurity As DirectorySecurity = dirinfo.GetAccessControl()
Select Case power
Case "FullControl"
dirsecurity.AddAccessRule(New FileSystemAccessRule(uername,FileSystemRights.FullControl,InheritanceFlags.ContainerInherit,PropagationFlags.InheritOnly,AccessControlType.Allow))
Exit Sub
Case "ReadOnly"
dirsecurity.AddAccessRule(New FileSystemAccessRule(username,FileSystemRights.Read,AccessControlType.Allow))
Exit Sub
Case "Write"
dirsecurity.AddAccessRule(New FileSystemAccessRule(username,FileSystemRights.Write,AccessControlType.Allow))
Exit Sub
Case "Modify"
dirsecurity.AddAccessRule(New FileSystemAccessRule(username,FileSystemRights.Modify,AccessControlType.Allow))
Exit Sub
End Select
dirinfo.SetAccessControl(dirsecurity)
End Sub
實現(xiàn)權(quán)限要求數(shù)據(jù)庫結(jié)構(gòu)如下:
用戶表(id,用戶名,密碼,角色id)
角色表(id,角色名,權(quán)限id)
權(quán)限表(id,權(quán)限名,鏈接地址)
文章名稱:vb.net文件控制權(quán)限,vbs權(quán)限獲取
URL標題:http://m.kartarina.com/article42/hdohec.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、網(wǎng)站導(dǎo)航、外貿(mào)建站、服務(wù)器托管、域名注冊、面包屑導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)