Exemple #1
0
 public AddNewPW(appForm _p, List <PasswordForSite> a)
 {
     InitializeComponent();
     parent = _p;
     pws    = a;
     this.FormBorderStyle = FormBorderStyle.None;
 }
Exemple #2
0
 public myLogs(appForm _p)
 {
     InitializeComponent();
     parent = _p;
     this.FormBorderStyle = FormBorderStyle.None;
     parent.parent.writeToServer("l100");
     logs              = parent.parent.readFromServer();
     this.mainTB.Text += logs;
 }
Exemple #3
0
 public myPasswords(appForm _p, List <PasswordForSite> a)
 {
     InitializeComponent();
     this.FormBorderStyle = FormBorderStyle.None;
     parent = _p;
     pws    = a;
     filter = new BindingList <PasswordForSite>(new List <PasswordForSite>(pws));
     mainList.DataSource = filter;
 }
Exemple #4
0
        public bool checkLogin(string name, string password, bool first)
        {
            try
            {
                connectToServer(Dns.GetHostName(), 1234);

                //sending login request to the server: ("c100" is a code for login request comand)
                if (first)
                {
                    writeToServer("c100");
                }

                //recieving server's public key as string:
                String serverPubKeyString = readFromServer();

                //converting server's public key (string) to server key (RSAPARAM):
                var sr = new System.IO.StringReader(serverPubKeyString);
                var xs = new System.Xml.Serialization.XmlSerializer(typeof(RSAParameters));
                serverPubKey = (RSAParameters)xs.Deserialize(sr);

                //sending ecrypted mail and password:
                var cypherText = EncryptData(name + "$" + password, serverPubKey);
                writeToServer(cypherText);

                //now waiting for response. Am I logged in?
                String loginStatus = readFromServer();

                if (String.Equals(loginStatus, "c105"))
                {
                    this.usrMail       = this.inpMail.Text;
                    this.usrPassword   = this.inpPw.Text;
                    this.Opacity       = 0;
                    this.ShowInTaskbar = false;
                    appForm aForm = new appForm(this);
                    aForm.Show();
                    return(true);
                }
            }
            catch (Exception e) { MessageBox.Show(e.ToString()); }
            return(false);
        }