コード例 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            using (var sfd = new SaveFileDialog())
            {
                sfd.Title           = @"Select path and enter filename";
                sfd.Filter          = @"Knight OnLine data tables |*.tbl";
                sfd.OverwritePrompt = true;
                if (DialogResult.OK == sfd.ShowDialog())
                {
                    var tbl = StaticReference.GetTableByFullName(_tableName);

                    if (tbl == null)
                    {
                        StaticReference.ShowError(this, LanguageManager.Get("Message_FileNotOpen"));
                        Close();
                        return;
                    }

                    foreach (var v in StaticReference.EncryptionMethods.Where(v => string.Compare(v.Name(), cbEncryptionList.Text, StringComparison.Ordinal) == 0))
                    {
                        tbl.SetEncryption(v);
                    }
                    tbl.SaveAs(sfd.FileName);
                    StaticReference.ShowInformation(this, LanguageManager.Get("Message_Done"));
                    Close();
                    // tePath.Text = sfd.FileName;
                }
            }
        }
コード例 #2
0
 private void frmExportAsSQL_Load(object sender, System.EventArgs e)
 {
     _tbl = StaticReference.GetTableByFullName(_tableName);
     if (_tbl == null)
     {
         StaticReference.ShowError(this, LanguageManager.Get("Message_NoFileOpen"));
         Close();
         return;
     }
     PopulateColumns();
     // meDescription.Text = StaticReference.GenerateKey(256);
 }
コード例 #3
0
ファイル: frmLogin.cs プロジェクト: yfz912/ko-table-editor
        private void btnDebug_Click(object sender, EventArgs e)
        {
            SHA256 mySHA256 = SHA256Managed.Create();
            var    key      = mySHA256.ComputeHash(Encoding.ASCII.GetBytes("Q3QgesV4wMug5ZtS7DenWAw3"));

            StaticReference.ShowWarning(this, BitConverter.ToString(key));
            var iv = new byte[16] {
                0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
            };
            var result = KODevLoginManager.EncryptString("wowowowowharam", key, iv);

            StaticReference.ShowError(this, result);
            //RegistrySettings.Load();
            // RegistrySettings.Save();
        }
コード例 #4
0
ファイル: frmLogin.cs プロジェクト: yfz912/ko-table-editor
        private void btnLogin_Click(object sender, EventArgs e)
        {
            var loginResult = KODevLoginManager.Login(teUsername.Text, tePassword.Text);

            switch (loginResult.Result.Substring(0, 29))
            {
            //LOGINSTATUS_KEY_3 (TOKEN METHODU İÇİN)  Token mevcut, fakat süresi dolmuş. Yeniden ID şifre ile token almak gerekli.
            case "LS003F5esRwzAPt33psnJdEt7eJkT":
            //LOGINSTATUS_KEY_4 (TOKEN METHODU İÇİN) Token mevcut, geçerli fakat kullanıcının gönderdiği değer yanlış!
            case "LS004GUcuNEM67D2P5PbUXqTLPHTt":
            //LOGINSTATUS_KEY_5 (PAROLA METHODU İÇİN) Hesap şuan kullanımda (token başkasında.)
            case "LS004rPrCHnnYLHUREjrh2fUggjQJ":
            //LOGINSTATUS_KEY_1 (PAROLA METHODU İÇİN) ID veya Parola yanlış.
            case "LS001Gs84DmanHUWmrWwLgDKysrFk":
                StaticReference.ShowError(this, loginResult.Message);
                break;

            //LOGINSTATUS_KEY_2 (TOKEN METHODU İÇİN)  Token mevcut, geçerli ve doğru.
            case "LS002RvkzvsDWeLdGDGCKHDKx8SuP":
            //LOGINSTATUS_KEY_T (PAROLA METHODU İÇİN) ID ve Parola doğru, token değeri JSON içerisinde token kısmına eklenir.
            case "LS00TF5esRwzAPt33psnJdEt7eJkT":
            {
                RegistrySettings.LoggedIn     = true;
                RegistrySettings.KeepLoggedIn = ceKeepLoggedIn.Checked;
                RegistrySettings.RememberMe   = ceRememberMe.Checked;

                RegistrySettings.Username = StaticReference.Encrypt(teUsername.Text, RegistrySettings._key, RegistrySettings._keySize);
                if (RegistrySettings.RememberMe)
                {
                    RegistrySettings.Password = StaticReference.Encrypt(tePassword.Text, RegistrySettings._key, RegistrySettings._keySize);
                }
                else
                {
                    RegistrySettings.Password = "******";
                }

                RegistrySettings.Save();
                Close();
            }
            break;

            //LOGINSTATUS_KEY_E
            case "LS00Ef9TV4vPbmGh9tytn7HdTMZp2":
                StaticReference.ShowError(this, loginResult.Message);
                break;
            }
        }
コード例 #5
0
        private void frmColumnEditor_Load(object sender, EventArgs e)
        {
            _tbl = StaticReference.GetTableByFullName(_tableName);
            if (_tbl == null)
            {
                StaticReference.ShowError(this, LanguageManager.Get("Message_NoFileOpen"));
                Close();
                return;
            }
            PopulateColumns();

            foreach (var v in _dataTypeList)
            {
                cbColumnDataType_Add.Properties.Items.Add(v);
                cbColumnDataType_Update.Properties.Items.Add(v);
            }
        }