
正文
vb.net用户权限 vbs权限
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
有关vb。net和access的管理系统的登陆权限问题
假设1为管理员,2为普通用户
从数据库里用户相对应的权限,用IF判断下
if (power == "2")
{
MenuIten2.Enabled = False;
}
相关问答
Q1: vb.net 操作文件夹用户权限
'
' 需要添加以下命名空间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
Q2: 如何实现VB.NET的权限控制
实现权限要求数据库结构如下:
用户表(id,用户名,密码,角色id)
角色表(id,角色名,权限id)
权限表(id,权限名,链接地址)
Q3: VB.NET登陆界面。要验证登录用户名和密码是否正确。登陆后有管理员和普通用户权限判断。管理员只能登录一
将用户名,密码,用户类型存在数据库中,登陆时比较输入的值是否与数据库相同即可。
Q4: vb.net,如何设置/读取 某用户 对 某文件夹 的访问权限?
不建议用在应用程序中操作共享文件或共享文件夹vb.net用户权限,这个东西往往会把软件做得过于死板。
Q5: VB.NET提高程序的运行权限 不受UAC的阻止
不能。 权限问题就是这么严格执行的。如果你没有权限就让你去访问那么必然就成了微软的漏洞了哦。
关于vb.net用户权限和vbs权限的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。






