如何授予登录管理员权限和C#中的邀请权限 [英] How to give privilege to login Administrator and Invited in C#

查看:98
本文介绍了如何授予登录管理员权限和C#中的邀请权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为诊所创建应用程序,需要使用权限创建登录。或者已经说我现在只需要给予特权但我不知道该怎么办。有人帮助我



I am creating application for a clinic and need to create login with privileges. either already say I've now only need to give the privileges but I do not see how to do. someone help me

<big>//Login Form</big>
namespace GESTAO_CLINICA
{
    public partial class frmLogin : Form
    {
        public frmLogin()
        {
            InitializeComponent();
            txtsenha.PasswordChar = '*';
        }

        <big>//Button Save</big>
        private void button2_Click(object sender, EventArgs e)
        {
           
            try
           {
                string sql="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=db_Maried;Data Source=TOBE-ANGOLA-PC";
                SqlConnection conn=new SqlConnection (sql);

                SqlCommand cmd = new SqlCommand("select UserName,Senha,TipoConta from tb_login where UserName='" + this.txtUsuario.Text + "'and Senha ='" + this.txtsenha.Text + "' ;", conn);
                SqlDataReader leitura;
                conn.Open();
                leitura = cmd.ExecuteReader();
                int count = 0;
                while (leitura.Read())
                {
                    count = count + 1;
                }
                if (count == 1)
                {

                    this.Hide();
                    Form1 c = new Form1(txtUsuario.Text); //Principal Form (Desktop)
                    c.ShowDialog();


                }
                else if (count > 1)
                {
                    //MessageBox.Show("Usuario ou senha Duplicada....Acesso Negado");
                    label3.Visible = true;

                    label3.Text = "Usuario ou senha Duplicada....Acesso Negado";
                }
                else
                {
                    //MessageBox.Show ("Usuario ou senha Errada....Por Favor Tente de Novo");
                    label3.Visible = true;
                    label3.Text = "Usuario ou senha Errada....Por Favor Tente de Novo";
                }
                conn.Close();
           }
            catch (Exception ex)
            {
                MessageBox.Show("Erro", ex.Message);
            }

        }

推荐答案

来解决你的问题,我建议你设置清单file.please请参阅:http://msdn.microsoft.com/en-us/library/bb756929.aspx



关于LDAP,我建议你可以参考以下KB。

http://support.microsoft.com/default.aspx?scid=kb;en-us;316748
to resolve your question,i suggest you to set your manifest file.please see:http://msdn.microsoft.com/en-us/library/bb756929.aspx

regarding LDAP,i recommended that you can refer the following KB.
http://support.microsoft.com/default.aspx?scid=kb;en-us;316748


这篇关于如何授予登录管理员权限和C#中的邀请权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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