Ejemplo n.º 1
0
        public ClientSock(ClubcUser usr)
        {
            m_sock.OnClose   += new ClubcChatSock.CloseDele(m_sock_OnClose);
            m_sock.OnConnect += new ClubcChatSock.ConnectDele(m_sock_OnConnect);
            m_sock.OnEvent   += new ClubcChatSock.EventDele(m_sock_OnEvent);
            m_sock.OnReceive += new ClubcChatSock.ReceiveDele(m_sock_OnReceive);

            m_sock.Create("127.0.0.1", usr.UserName, usr.Password);
        }
Ejemplo n.º 2
0
 public static bool CheckLogined(this Page p, out ClubcUser usr)
 {
     usr = p.ReadSession <ClubcUser>("usr");
     if (usr != null)
     {
         return(true);
     }
     else
     {
         p.ErrorMsg("로그인하지 않았습니다!");
         return(false);
     }
 }
Ejemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            List <string> ClassStrList = ClubcUser.GetClassStrList();

            if (ClassStrList != null)
            {
                cbxUserClass.DataSource = ClassStrList;
            }
            else
            {
                MessageBox.Show("SQL 명령 실행에 실패했습니다.", "에러", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 4
0
        private void btnCreateUser_Click(object sender, EventArgs e)
        {
            ClubcUser user = ClubcUser.CreateUser(tbUserId.Text, tbUserPass.Text, cbxUserClass.Text, tbNickname.Text);

            if (user != null)
            {
                MessageBox.Show(string.Format("아이디 : {0}\n비밀번호 : {1}\n등급 : {2}", user.UserName, user.Password, user.UserClassStr),
                                "성공", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("계생 생성에 실패했습니다.", "에러", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 5
0
        protected void LoginBox_Authenticate(object sender, AuthenticateEventArgs e)
        {
            ClubcUser usr = new ClubcUser();

            if (Authentication.Login(LoginBox.UserName, LoginBox.Password, usr))
            {
                Session["usr"]  = usr;
                e.Authenticated = true;
            }
            else
            {
                e.Authenticated = false;
            }
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClubcUser usr = this.ReadSession <ClubcUser>("usr");

            if (usr == null)
            {
                LoginPanel.Visible = true;
                MainPanel.Visible  = false;
            }
            else
            {
                NickLabel.Text = usr.Nickname;

                LoginPanel.Visible = false;
                MainPanel.Visible  = true;
            }
        }