示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (manageEntry.ShowDialog() == DialogResult.OK)
            {
                AutoTypeEntry ate = new AutoTypeEntry(manageEntry.EntryName, manageEntry.EntryValue);
                AutoTypeEntryManager.Instance.Add(ate);
                AutoTypeEntryManager.Instance.Save();

                ReloadEntries();
            }
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            AutoTypeEntry ate         = (AutoTypeEntry)comboBox1.SelectedItem;
            string        processInfo = comboBox2.Text;

            if (ate != null)
            {
                int    start       = processInfo.IndexOf("[");
                int    end         = processInfo.IndexOf("]");
                int    length      = (end - start);
                string processName = processInfo.Substring(start, length);
                processName = processName.Replace('[', ' ');
                processName = processName.Replace(']', ' ');
                processName = processName.Trim();

                Process[] pList = Process.GetProcessesByName(processName);

                if (pList.Length > 0)
                {
                    Process selectedProcess = null;

                    foreach (Process p in pList)
                    {
                        if (processInfo.Contains(p.MainWindowTitle))
                        {
                            selectedProcess = p;
                            break;
                        }
                    }

                    if (selectedProcess != null)
                    {
                        string decryptedStr = ate.Decrypt(ate.EncryptedPassword);

                        ShowWindow(selectedProcess.MainWindowHandle, SW_RESTORE);
                        SetForegroundWindow(selectedProcess.MainWindowHandle);

                        SendKeys.Send(decryptedStr);
                    }
                }
            }
        }
示例#3
0
        private void button3_Click(object sender, EventArgs e)
        {
            int           index = GetSelectedIndex();
            AutoTypeEntry ate   = AutoTypeEntryManager.Instance[index];

            if (ate != null)
            {
                manageEntry.EntryName  = ate.Name;
                manageEntry.EntryValue = ate.Decrypt(ate.EncryptedPassword);

                if (manageEntry.ShowDialog() == DialogResult.OK)
                {
                    ate.Name = manageEntry.EntryName;
                    ate.EncryptedPassword = ate.Encrypt(manageEntry.EntryValue);

                    AutoTypeEntryManager.Instance[index] = ate;
                    AutoTypeEntryManager.Instance.Save();

                    ReloadEntries();
                }
            }
        }