多级登录访问 [英] Multi level login access

查看:73
本文介绍了多级登录访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hai,我需要您的帮助和帮助,目前我正在为System Department shop创建登录页面.此系统基于Windows应用程序.此登录页面已连接到数据库,只有数据库中具有其用户名和密码的用户允许访问.我需要有关如何修改登录页面的建议,以限制级别的用户访问系统中的页面.此限制级别的访问权限基于其部门.例如,如果用户是机械部门,则在用户成功登录后,他自动将仅指向机械页面;如果用户来自土木部门,则在成功登录后,将自动指向机械页面.在这里,我附上我用于登录页面的代码,但是此代码仅验证数据库中的用户名和密码.对于您的信息,我正在使用Visual Studio和sql2005.

hai , i need your idea and assists, currently i am creating login page for System department shop.This system is based on windows application.This login page are connected to database,only user which have their username and passsword in the database is allow to access. i need advice how i can modify my login page which limit level user to access page in the system . This limit level access is based on their department. For example if the user are form department mechanical , after the user succesfully login he autmatically will be pointing to mechanical page only, if the user are from civil department he will automatically be pointing to civil page after login successful . Here i attach my code for login page, but this code only verify username and password in the database .For your info i am using visual studio and sql 2005.

Public Class Login
 
    Dim r = Me.StaffTableAdapter1
    Private Sub btnlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click

        Dim r = Me.StaffTableAdapter1.Username_password(Me.txtusername.Text, Me.txtpassword.Text)

        If r Is Nothing Then
            MessageBox.Show("Please Enter Your Username  and Password ")
        Else
            Me.Hide()
            databasestatus.Show()
            MessageBox.Show("You Are Login")
        End If


    End Sub
End Class

推荐答案

创建用户时,添加一个额外的字段来表示用户的访问权限(访问权限),表字段为用户名,密码,密码.当用户尝试登录并根据其访问权限显示表单时,请选择用户特权
When creating users add one extra field for representing users access previlage(access permission), Table fields are UserName, Password, Prvlge. Select users previlage when the user trying to Login and show the forms based on its access permission


这篇关于多级登录访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆