protected void Decode_Click(object sender, EventArgs e)
        {
            try
            {
                ErrorTips.Text = emptyString;
                ErrorText.Text = emptyString;

                string encryptedText = EncryptedText.Text;
                string key           = KeyString.Text;

                EncoderV1.AssembleKeywords(key);

                string temp = EncoderV1.DecodeEncyptedTextToHexArray(encryptedText);

                if (key == null || key == "")
                {
                    ErrorText.Text = "请输入神秘代码哦。";
                }
                else if (temp == null && encryptedText != null)
                {
                    ErrorText.Text =
                        "对不起!您输入的神秘代码或待解码密文有问题,我解不出来…";
                }

                RawText.Text = temp;
            }
            catch (Exception ex)
            {
                ErrorTips.Text = errorCHN;
                ErrorText.Text = ex.Message;
            }
        }
Ejemplo n.º 2
0
        private void Decode_Click(object sender, EventArgs e)
        {
            try
            {
                ErrorTips.Text = emptyString;
                ErrorText.Text = emptyString;

                string encryptedText = EncryptedText.Text;
                string key           = KeyString.Text;

                EncoderV1.AssembleKeywords(key);

                string temp = EncoderV1.DecodeEncyptedTextToHexArray(encryptedText);

                if (key == null || key == "")
                {
                    ErrorText.Text = language == "CHN" ? "请输入神秘代码哦。" : "Please type in your key";
                }
                else if (temp == null && encryptedText != null)
                {
                    ErrorText.Text = language == "CHN" ?
                                     "对不起!您输入的神秘代码或待解码密文有问题,我解不出来…" :
                                     "Sorry, the key or encrypted text you typed in does not work.";
                }

                RawText.Text = temp;
            }
            catch (Exception ex)
            {
                ErrorTips.Text = errorLangNow;
                ErrorText.Text = ex.Message;
            }
        }