Example #1
0
        private void btn_change_change_Click(object sender, EventArgs e) // 변경 버튼 클릭
        {
            // 사용자가 입력한 정보를 들고 옴
            input_ip         = tb_search_ip.Text.ToString();
            input_email      = tb_search_email.Text.ToString();
            input_pre_code   = tb_search_pre_code.Text.ToString();
            input_post_code  = tb_search_post_code.Text.ToString();
            input_post_code2 = tb_search_post_code2.Text.ToString();

            db_ip       = ini_data.GetIniValue("Remote Control System Information", "UserIp");                   // 아이피 가져오기
            db_email    = ini_data.GetIniValue("Remote Control System Information", "UserEmail");                // 이메일
            db_pre_code = aes.AES_Decode(ini_data.GetIniValue("Remote Control System Information", "UserCode")); // 코드 가져오기

            if (input_ip.Equals(db_ip) && input_email.Equals(db_email) && input_pre_code.Equals(db_pre_code))    // 아이피, 이메일, 이전 코드가 DB 정보와 일치해야 함.
            {
                if (input_post_code.Equals(input_post_code2))                                                    // 재 입력한 비밀번호가 일치해야 함.
                {
                    ini_data.SetIniValue("Remote Control System Information", "Usercode", aes.AES_Encode(input_post_code2));
                    MessageBox.Show("Change you Cert code", "비밀번호 변경 완료.");
                    this.Hide();
                }
                else // 재 입력한 비밀번호가 다를 때
                {
                    MessageBox.Show("변경 비밀번호를 확인 해 주세요.", "Check post code");
                }
            }
            else // 사용자가 입력한 정보와 다를 때
            {
                MessageBox.Show("아이피와 비밀번호를 확인 해 주세요.", "Check Information");
            }
        }
Example #2
0
        private void SetStartUp(string appName, bool enable)
        {
            RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);

            if (enable) // 시작 프로그램 등록
            {
                if (registryKey.GetValue(appName) == null)
                {
                    registryKey.SetValue(appName, Application.ExecutablePath.ToString());
                    ini_data.SetIniValue("Remote Control System Information", "Is_AutoRun", "True");
                }
            }
            else // 시작 프로그램 해제
            {
                registryKey.DeleteValue(appName, false);
                ini_data.SetIniValue("Remote Control System Information", "Is_AutoRun", "False");
            }
        }
Example #3
0
        private void btn_join_join_Click(object sender, EventArgs e)
        {
            this.login_ip    = label_join_ip.Text.ToString();
            this.login_code  = aes.AES_Encode(tb_join_code1.Text.ToString());
            this.login_email = tb_join_email.Text.ToString();

            if (String.Compare(tb_join_code1.Text, tb_join_code2.Text) != 0) // 사용자가 가입하기 위해 입력한 코드가 다르면
            {
                MessageBox.Show("Check to your code");
                tb_join_code1.Text = "";
                tb_join_code2.Text = "";
                tb_join_code1.Focus();
            }
            else if (String.IsNullOrEmpty(login_email)) // 이메일을 입력하지 않았으면
            {
                MessageBox.Show("이메일을 입력 해 주세요.");
            }
            else if (IsValidEmail(login_email) == false) // 이메일 정규식에 맞지 않으면
            {
                MessageBox.Show("올바른 이메일 형식을 입력하세요.");
            }
            // 사용자가 가입하기 위해 입력한 코드가 같고 이메일 형식이 맞아야 함
            else if (String.Compare(tb_join_code1.Text, tb_join_code2.Text) == 0 && IsValidEmail(login_email))
            {
                this.is_join = "joined"; // 가입 되었다고 함.

                filepath = Path.Combine(Path.GetTempPath(), temp_path);

                if (di.Exists == false)
                {
                    di.Create(); // 폴더가 없으면 생성
                }

                ini_data = new iniData(filepath);

                ini_data.SetIniValue("Remote Control System Information", "UserIp", login_ip);
                ini_data.SetIniValue("Remote Control System Information", "UserCode", login_code);
                ini_data.SetIniValue("Remote Control System Information", "UserEMail", login_email);
                ini_data.SetIniValue("Remote Control System Information", "UserIsJoin", is_join);

                Application.Restart(); // 회원가입이 진행된 이후 어플리케이션을 다시 실행해야 함.
            }
        }