
正文
vb.net权限设置,vb拒绝的权限
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
vb.net windows7下设置程序管理员权限(会的进)
VB.net(VS2008)里面比C#还好弄,不需要自己加manifest,直接在项目属性的“应用程序”里面点击“查看UAC设置”,在新打开的app.manifest里面把 requestedExecutionLevel level="asInvoker" uiAccess="false" / 替换成 requestedExecutionLevel level="requireAdministrator" uiAccess="false" / 再编译就行了。
相关问答
Q1: vb.net,如何设置/读取 某用户 对 某文件夹 的访问权限?
不建议用在应用程序中操作共享文件或共享文件夹,这个东西往往会把软件做得过于死板。
Q2: 如何实现VB.NET的权限控制
实现权限要求数据库结构如下:
用户表(id,用户名,密码,角色id)
角色表(id,角色名,权限id)
权限表(id,权限名,链接地址)
Q3: vb.net 操作文件夹用户权限
'
' 需要添加以下命名空间:
' 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






