예제 #1
0
파일: Login.cs 프로젝트: amarriner/Login
        public override void Load()
        {
            Name = "Login";
            Description = "A plugin to restrict logins in various ways";
            Author = "amarriner";
            Version = "0.2.3";
            TDSMBuild = 33;

            plugin = this;

            this.registerHook(Hooks.PLAYER_LOGIN);
            this.registerHook(Hooks.PLAYER_LOGOUT);
            this.registerHook(Hooks.PLAYER_TILECHANGE);
            this.registerHook(Hooks.PLAYER_PROJECTILE);
            this.registerHook(Hooks.PLAYER_PARTYCHANGE);
            this.registerHook(Hooks.PLAYER_FLOWLIQUID);
            this.registerHook(Hooks.PLAYER_EDITSIGN);
            this.registerHook(Hooks.PLAYER_CHEST);
            this.registerHook(Hooks.PLAYER_CHESTBREAK);

            AddCommand("invalidate")
                .WithAccessLevel(AccessLevel.OP)
                .WithDescription("Allows OPs to invalidate players manually")
                .WithHelpText("/invalidate <player>")
                .Calls(Commands.Commands.InvalidatePlayer);

            AddCommand("setpoint")
                .WithAccessLevel(AccessLevel.OP)
                .WithDescription("Allows OPs to set lobby or validated points")
                .WithHelpText("setpoint lobby|validated")
                .Calls(Commands.Commands.SetPoint);

            AddCommand("testpoint")
                .WithAccessLevel(AccessLevel.OP)
                .WithDescription("Allows OPs to test lobby or validated points")
                .WithHelpText("testpoint lobby|validated")
                .Calls(Commands.Commands.TestPoint);

            AddCommand("validate")
                .WithAccessLevel(AccessLevel.OP)
                .WithDescription("Allows OPs to validate players manually")
                .WithHelpText("/validate <player>")
                .Calls(Commands.Commands.ValidatePlayer);
        }
예제 #2
0
 static void Main(string[] args)
 {
     using (Login server = new Login())
         server.Execute();
 }
예제 #3
0
파일: Main.cs 프로젝트: HongDuongg/Win_Form
        private void mnDangnhap_Click(object sender, EventArgs e)
        {
            Login frm1 = new Login();

            frm1.Show();
        }
예제 #4
0
파일: Register.cs 프로젝트: Jlp18/CSharp
        private void RegBtn_Click(object sender, EventArgs e)
        {
            //检查用户是否存在
            string userName = Username.Text.Trim();

            /**
             * 连接数据库
             */
            string          constr = "DataBase = test; Data Source = 127.0.0.1;Port = 3307;User Id=root;Password=jlp1996;pooling=false;CharSet=utf8;";
            MySqlConnection mycon  = new MySqlConnection();

            mycon.ConnectionString = constr;
            mycon.Open();  //打开数据库


            //查询用户是否存在
            MySqlCommand checkCommand = mycon.CreateCommand();
            string       s2           = "select username from tb1 where username = '******'";

            checkCommand.CommandText = s2;
            MySqlDataAdapter check = new MySqlDataAdapter();

            check.SelectCommand            = checkCommand;
            check.SelectCommand.Connection = mycon;  //初始化
            DataSet checkData = new DataSet();
            int     n         = check.Fill(checkData, "tb1");

            if (n != 0)
            {
                MessageBox.Show("此用户名已存在");
                Username.Text   = ""; //清空输入文本框
                Password.Text   = "";
                RePassword.Text = "";
            }
            else if (Username.Text == "" || Password.Text == "" || RePassword.Text == "")
            {
                MessageBox.Show("请将信息填写完整");
                Username.Focus();
            }
            else if (RePassword.Text != Password.Text)
            {
                MessageBox.Show("密码不一致");
                Password.Text   = ""; //清空输入框
                RePassword.Text = "";
            }
            else
            {
                //注册成功,上传数据
                string       s3    = "insert into tb1 (username , password) values ('" + Username.Text + "' , '" + Password.Text + "')";
                MySqlCommand mycom = new MySqlCommand(s3, mycon);
                mycom.ExecuteNonQuery(); //执行语句
                mycon.Close();           //关闭连接
                mycom = null;
                mycon.Dispose();         //??释放对象

                MessageBox.Show("注册成功");
                this.Close();
                Login lg = new Login();
                lg.ShowDialog();
            }
        }
예제 #5
0
 private void btn_Salir_Click(object sender, EventArgs e)
 {
     Login log = new Login();
     this.Close();
     log.Show();
 }
예제 #6
0
 public kitchenView(Login login)
 {
     InitializeComponent();
     this.login = login;
 }