Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string Site     = website.Text;
            string Link     = link.Text;
            string User     = user.Text;
            string Password = Hash.Hash(password.Text);

            if (User != "" && Password != "" && Site != "" && Link != "")
            {
                Psw temp = new Psw(User, Password, Site, Link);
                this.parent.array.Add(temp);
                StreamWriter sw = new StreamWriter(Environment.CurrentDirectory + "/save.txt");
                foreach (Psw password in this.parent.array)
                {
                    sw.WriteLine(password.user + "," + password.pswrd + "," + password.SiteName + "," + password.SiteLink);
                }
                sw.Close();
                this.Close();
                parent.Close();
                Form1 f = new Form1();
                f.Show();
            }
            else
            {
                MessageBox.Show("Please fill all avalable fields");
            }
        }
Пример #2
0
        public void Link_Click(object sender, EventArgs e)
        {
            Psw      objet = array[((buttonp)sender).index];
            GoToForm go    = new GoToForm(this, objet);

            go.Show();
        }
Пример #3
0
        public Form1()
        {
            InitializeComponent();
            if (File.Exists(Environment.CurrentDirectory + "/save.txt"))
            {
                StreamReader rd = new StreamReader(Environment.CurrentDirectory + "/save.txt");
                string       line;
                while ((line = rd.ReadLine()) != null)
                {
                    string[] ligne     = line.Split(',');
                    Psw      temporary = new Psw(ligne[0], ligne[1], ligne[2], ligne[3]);
                    array.Add(temporary);
                }
                rd.Close();
            }

            this.SuspendLayout();
            tableLayoutpanel.RowStyles.Clear();
            tableLayoutpanel.TabIndex = 0;

            tableLayoutpanel.ColumnCount = 5;
            for (int i = 0; i < tableLayoutpanel.ColumnCount; i++)
            {
                tableLayoutpanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f));
            }

            tableLayoutpanel.RowCount = array.Count;

            for (int i = 0; i < tableLayoutpanel.RowCount; i++)
            {
                if (tableLayoutpanel.RowCount < 7)
                {
                    tableLayoutpanel.RowStyles.Add(new RowStyle(SizeType.Percent, 50f));
                }
                else
                {
                    tableLayoutpanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 60));
                }
            }

            for (int i = 0; i < tableLayoutpanel.RowCount; i++)
            {
                Label label0 = new Label();
                label0.Text      = array[i].SiteName;
                label0.Font      = new Font("arial narrow", 16f);
                label0.ForeColor = Color.Black;
                label0.BackColor = TransparencyKey;
                label0.TextAlign = ContentAlignment.MiddleCenter;
                label0.Dock      = DockStyle.Fill;

                Label label1 = new Label();
                label1.Text      = array[i].user;
                label1.Font      = new Font("arial narrow", 16f);
                label1.ForeColor = Color.Black;
                label1.BackColor = TransparencyKey;
                label1.TextAlign = ContentAlignment.MiddleCenter;
                label1.Dock      = DockStyle.Fill;

                Label label2 = new Label();
                label2.Text = new Func <string>(() => { string text = ""; for (int j = 0; j < array[i].pswrd.Length; j++)
                                                        {
                                                            text += "*";
                                                        }
                                                        return(text); })();
                label2.Font      = new Font("arial narrow", 16f);
                label2.ForeColor = Color.Black;
                label2.Anchor    = AnchorStyles.None;
                label2.BackColor = TransparencyKey;
                label2.TextAlign = ContentAlignment.MiddleCenter;
                label1.Dock      = DockStyle.Fill;

                buttonp show = new buttonp(i);
                show.Text      = "click here to show\n the details of " + array[i].SiteName;
                show.Font      = new Font("arial narrow", 12f);
                show.ForeColor = Color.Black;
                show.BackColor = TransparencyKey;
                show.TextAlign = ContentAlignment.MiddleCenter;
                show.Dock      = DockStyle.Fill;
                show.FlatStyle = FlatStyle.Flat;
                show.FlatAppearance.BorderSize = 0;
                show.Click += Show_Click;

                buttonp link = new buttonp(i);
                link.Text      = "click here to connect to " + array[i].SiteName;
                link.Font      = new Font("arial narrow", 12f);
                link.ForeColor = Color.Black;
                link.BackColor = TransparencyKey;
                link.TextAlign = ContentAlignment.MiddleCenter;
                link.Dock      = DockStyle.Fill;
                link.FlatStyle = FlatStyle.Flat;
                link.FlatAppearance.BorderSize = 0;
                link.Click += Link_Click;

                tableLayoutpanel.Controls.Add(label0, 0, i);
                tableLayoutpanel.Controls.Add(label1, 1, i);
                tableLayoutpanel.Controls.Add(label2, 2, i);
                tableLayoutpanel.Controls.Add(show, 3, i);
                tableLayoutpanel.Controls.Add(link, 4, i);
            }
            this.ResumeLayout();
        }
Пример #4
0
        public void Show_Click(object sender, EventArgs e)
        {
            Psw objet = array[((buttonp)sender).index];

            MessageBox.Show("Site: " + objet.SiteName + "\nlink: " + objet.SiteLink + "\nuser: "******"\npassword: " + hash.UnHash(objet.pswrd));
        }
Пример #5
0
 public GoToForm(Form1 parent, Psw objet)
 {
     this.parent = parent;
     this.objet  = objet;
     InitializeComponent();
 }