Ejemplo n.º 1
0
        public ServerMain()
        {
            InitializeComponent();
            lv_roomList.View = View.Details;

            FormClosing += new FormClosingEventHandler(FrmMainControl_FormClosing);

            sessionList = new List <Session>();
            roomList    = new List <Room>();

            string      localIP = "Not available, please check your network seetings!";
            IPHostEntry host    = Dns.GetHostEntry(Dns.GetHostName());

            foreach (IPAddress ip in host.AddressList)
            {
                if (ip.AddressFamily == AddressFamily.InterNetwork)
                {
                    localIP = ip.ToString();
                    break;
                }
            }

            lab_ip.Text   = localIP;
            lab_port.Text = ConfigurationManager.AppSettings["ServerPORT"];

            IList <Hashtable> _getMethod = new _Sel().GetListHashData(null, "getRunMethod");

            if (_getMethod == null)
            {
                MessageBox.Show("연결안됨");
            }
        }
Ejemplo n.º 2
0
        private void login_process()
        {
            if (txtPass.Text == null || txtPass.Text == "")
            {
                MessageBox.Show("패스워드를 입력하세요.");
                return;
            }

            HashAlgorithm hash = new SHA256Managed();

            byte[] plainTextBytes = System.Text.Encoding.UTF8.GetBytes(txtPass.Text);
            byte[] hashBytes      = hash.ComputeHash(plainTextBytes);

            //in this string you got the encrypted password
            string hashValue = Convert.ToBase64String(hashBytes);

            Hashtable _param = new Hashtable();

            _param.Add("MGS_USERID", txtUserId.Text.Trim());
            _param.Add("PASSWD", hashValue);

            _Sel _sel = new _Sel();
            IList <Hashtable> _list = _sel.GetListHashData(_param, "getLoginUserInfo");

            String[] login_user_info = new string[12];

            if (_list.Count > 0)
            {
                var user = _list[0];
                login_user_info[0] = txtUserId.Text.Trim();
                login_user_info[1] = _cu.rtnHtS(user["SWCD"]);
                login_user_info[2] = _cu.rtnHtS(user["NAME"]);
                login_user_info[3] = _cu.rtnHtS(user["LEVEL_CD"]);
                login_user_info[4] = _cu.rtnHtS(user["ADMIN"]);
                login_user_info[5] = _cu.rtnHtS(user["ORG_CD"]);
                login_user_info[6] = _cu.rtnHtS(user["GROUP_ID"]);
                login_user_info[7] = _cu.rtnHtS(user["BADMIN"]);
                login_user_info[8] = txtPass.Text;

                login_user_info[9]  = serverIP.Text;
                login_user_info[10] = serverPort.Text;

                login_user_info[11] = txtPass.Text;

                MainProg.Instance.ConfigWriteProfile(login_user_info[0], login_user_info[9], login_user_info[10]);

                MainProg.CConf.userId = login_user_info[0];

                this.Visible = false;
                MainForm mf = new MainForm(login_user_info);
                mf.Show();
            }
            else
            {
                MessageBox.Show("패스워드를 다시 입력하세요.");
                return;
            }
        }
Ejemplo n.º 3
0
        public Hashtable LoginCheck(String userId, String password)
        {
            Hashtable _param = new Hashtable();

            _param.Add("MGS_USERID", userId);
            _param.Add("PASSWD", password);

            IList <Hashtable> _list = new _Sel().GetListHashData(_param, "getLoginUserInfo");

            //IList<wcfUser> _rtnList = null;
            Hashtable _retHash = null;

            foreach (Hashtable _item in _list)
            {
                _retHash = new Hashtable();
                _retHash = _item;
            }
            return(_retHash);
        }
Ejemplo n.º 4
0
        void getRunMethod(object sender, ElapsedEventArgs e)
        {
            if (timerConnectServer.Interval != 300000)
            {
                timerConnectServer.Interval = 300000; //5분
            }
            try
            {
                IList <Hashtable> _getMethod = new _Sel().GetListHashData(null, "getRunMethod");

                foreach (Hashtable _item in _getMethod)
                {
                    switch (_item["DATA"].ToString())
                    {
                    case "RELOAD_GROUPD":

                        PacketData_ReloadGroup req = new PacketData_ReloadGroup();
                        //로그인인원에게 리스트 갱신처리
                        foreach (Session session in sessionList)
                        {
                            session.Send(req);
                        }
                        break;

                    default:
                        break;
                    }
                    //한건만 실행처리
                    break;
                }
                new _Ins().DeleteHashData(null, "delRunMethod");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                System.Windows.Forms.Application.Exit();
            }

            System.Windows.Forms.Application.DoEvents();
        }
Ejemplo n.º 5
0
        public IList <Hashtable> getUserLIst()
        {
            IList <Hashtable> _list = new _Sel().GetListHashData(null, "getUserInfo");

            return(_list);
        }
Ejemplo n.º 6
0
        public MessageFormBox(String userId, String selectUserList, String messageNum)
        {
            InitializeComponent();

            txt_rcv_user.BackColor = System.Drawing.Color.White;

            if (selectUserList != null && selectUserList.Length > 0)
            {
                String[] sendUserList = selectUserList.Split('^');

                foreach (String rcvUserid in sendUserList)
                {
                    if (rcvUserid.Equals("") || !rcvUserid.Substring(0, 1).Equals("F"))
                    {
                        continue;
                    }
                    String _memberName = MainProg.getUserInfoByKey("MEMBERID", rcvUserid.Substring(1)).MEMBERNAME;
                    txt_rcv_user.Text += _memberName + ";";
                }

                if (!sendUserList.Contains(userId))
                {
                    String _memberName = MainProg.getUserInfoByKey("MEMBERID", userId.Substring(1)).MEMBERNAME;
                    txt_rcv_user.Text += _memberName + ";";
                }
            }
            else
            {
                String _memberName = MainProg.getUserInfoByKey("MEMBERID", userId.Substring(1)).MEMBERNAME;
                txt_rcv_user.Text += _memberName + ";";
            }

            if (messageNum == null)
            {
                messageBody.DocumentText = String.Empty;
            }
            else
            {
                Hashtable _param = new Hashtable();
                _param.Add("C_INDEX", messageNum);
                _param.Add("MESSAGE_KB", "1");
                IList <Hashtable> _message = new _Sel().GetListHashData(_param, "getBoarderList");

                foreach (Hashtable _item in _message)
                {
                    var str = "<html><head></head><body><br/><br/><br/>" + "[" + txt_rcv_user.Text.Replace(";", "") + "님이 보낸글]<br/>";

                    RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Singleline;
                    Regex        regx    = new Regex("<body>(?<theBody>.*)</body>", options);

                    Match  match   = regx.Match(_cu.rtnHtS(_item["CONTEXT"]));
                    string theBody = String.Empty;
                    if (match.Success)
                    {
                        theBody = match.Groups["theBody"].Value;
                    }
                    str += theBody;
                    str += "</ body ></ html > ";

                    messageBody.DocumentText += str;
                }
            }

            lvFileList.View = View.Details;
            lvFileList.Columns.Add("fileName", 600, HorizontalAlignment.Left);
            lvFileList.Columns.Add("fileFullName", 0);

            lvFileList.HeaderStyle = ColumnHeaderStyle.None;
        }