Esempio n. 1
0
        private void Btn_Send_Click(object sender, EventArgs e)
        {
            txt_Message_Table.AppendText("Me " + DateTime.Now + "\n" + txt_Sent_Message_Table.Text + "\n\n");
            message = RSACrypt.EncryptString(txt_Sent_Message_Table.Text, Method.PublicKey);
            Thread thread = new Thread(() =>
            {
                Method method = new Method();
                method.Method_SendMessage(message);
            });

            thread.Start();
            txt_Sent_Message_Table.Text = "";
        }
Esempio n. 2
0
 private void Btn_Sign_In_Click(object sender, EventArgs e)
 {
     method.Method_Get_Login_Account_And_Account(txt_Account.Text, txt_Password.Text);
     method.Method_Sign_in(LoginCrypt.GetMd5(Method.Login_Account), LoginCrypt.GetMd5(Method.Login_PassW));
     if (method.Show_Main_Table == 1)
     {
         Method.Account_Me  = LoginCrypt.GetMd5(Method.Login_Account);
         Method.Account_You = method.Method_Get_TaAccount();
         string[] sKeys = RSACrypt.GenerateKeys();
         Method.My_PrivateKey = sKeys[0];
         Method.PublicKey     = sKeys[1];
         method.Method_Send_PrivateKey();
         this.Hide();
     }
     method.Method_Change_State("O");
 }
Esempio n. 3
0
 public string Method_Get_Message()
 {
     Method_Get_PrivateKey();
     using (SqlConnection conn = new SqlConnection(DB_Sign_in))
     {
         conn.Open();
         string     sql = "select * from FSC_Login where Account='" + Account_You + "'";
         SqlCommand cmd = new SqlCommand(sql, conn);
         cmd.CommandType = CommandType.Text;
         SqlDataReader sdr = cmd.ExecuteReader();
         sdr.Read();
         string State  = sdr.GetString(sdr.GetOrdinal("Chat"));
         string State2 = RSACrypt.DecryptString(State, You_PrivateKey);
         return(State2);
     }
 }