Ejemplo n.º 1
0
 private void mainForm_Load(object sender, EventArgs e)
 {
     try
     {
         foreach (myProcess myproc in _myProcList)
         {
             procslist.Items.Add(new ListViewItem(new String[] { myproc.ID, myproc.Name, myproc.Priority, myproc.Filename }));
         }
     }
     catch (Exception ex)
     {
         InformUser.showError(ex.Message);
     }
 }
Ejemplo n.º 2
0
 private void popMenuCopyHostItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (credslist.SelectedItems.Count == 1)
         {
             Clipboard.SetData(DataFormats.Text, credslist.SelectedItems[0].SubItems[0].Text);
         }
     }
     catch (Exception ex)
     {
         InformUser.showError(ex.Message);
     }
 }
Ejemplo n.º 3
0
 private void procslist_MouseClick(object sender, MouseEventArgs e)
 {
     try
     {
         if (e.Button == MouseButtons.Right)
         {
             Point pt = popupMenu.PointToScreen(e.Location);
             popupMenu.Show(pt);
         }
     }
     catch (Exception ex)
     {
         InformUser.showError(ex.Message);
     }
 }
Ejemplo n.º 4
0
 public static Boolean KillProcess(int id)
 {
     try
     {
         Process p = Process.GetProcessById(id);
         p.Kill();
         p.WaitForExit();
         return(true);
     }
     catch (Exception ex)
     {
         InformUser.showError(ex.Message);
         return(false);
     }
 }
Ejemplo n.º 5
0
 private void RefreshProcs()
 {
     try
     {
         procslist.Items.Clear();
         _myProcList  = ProcessManager.GetProcesses;
         counter.Text = _myProcList.Count + " processes.";
         foreach (myProcess myproc in _myProcList)
         {
             procslist.Items.Add(new ListViewItem(new String[] { myproc.ID, myproc.Name, myproc.Priority, myproc.Filename }));
         }
     }
     catch (Exception ex)
     {
         InformUser.showError(ex.Message);
     }
 }
Ejemplo n.º 6
0
        private static List <FileZillaCredentials> ReadFile(String filename)
        {
            List <FileZillaCredentials> _list = new List <FileZillaCredentials>();

            try
            {
                if (File.Exists(filename))
                {
                    XmlTextReader xmlTReader = new XmlTextReader(filename);
                    XmlDocument   xmlDoc     = new XmlDocument();
                    xmlDoc.Load(xmlTReader);

                    foreach (XmlNode xmlNode in xmlDoc.DocumentElement.ChildNodes[0].ChildNodes)
                    {
                        FileZillaCredentials fzc = new FileZillaCredentials();
                        foreach (XmlNode xmlNodeChild in xmlNode.ChildNodes)
                        {
                            if (xmlNodeChild.Name == "Host")
                            {
                                fzc.Host = xmlNodeChild.InnerText;
                            }
                            if (xmlNodeChild.Name == "Port")
                            {
                                fzc.Port = xmlNodeChild.InnerText;
                            }
                            if (xmlNodeChild.Name == "User")
                            {
                                fzc.User = xmlNodeChild.InnerText;
                            }
                            if (xmlNodeChild.Name == "Pass")
                            {
                                fzc.Pass = xmlNodeChild.InnerText;
                            }
                        }
                        _list.Add(fzc);
                    }
                }

                return(_list);
            }
            catch (Exception ex)
            {
                InformUser.showError(ex.Message);
                return(_list);
            }
        }
Ejemplo n.º 7
0
 private void killProcessMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (procslist.SelectedItems.Count == 1)
         {
             if (ProcessManager.KillProcess(int.Parse(procslist.SelectedItems[0].SubItems[0].Text)))
             {
                 InformUser.showInfo("The process has been killed..");
                 RefreshProcs();
             }
         }
     }
     catch (Exception ex)
     {
         InformUser.showError(ex.Message);
     }
 }
Ejemplo n.º 8
0
 private void popupMenu_Opening(object sender, CancelEventArgs e)
 {
     try
     {
         if (procslist.SelectedItems.Count == 1)
         {
             killProcessMenuItem.Visible = true;
         }
         else
         {
             killProcessMenuItem.Visible = false;
         }
     }
     catch (Exception ex)
     {
         InformUser.showError(ex.Message);
     }
 }
Ejemplo n.º 9
0
 private void popupMenu_Opening(object sender, CancelEventArgs e)
 {
     try
     {
         if (credslist.SelectedItems.Count == 1)
         {
             popMenuCopyHostItem.Visible     = true;
             popMenuCopyUsernameItem.Visible = true;
             popMenuCopyPasswordItem.Visible = true;
         }
         else
         {
             popMenuCopyHostItem.Visible     = false;
             popMenuCopyUsernameItem.Visible = false;
             popMenuCopyPasswordItem.Visible = false;
         }
     }
     catch (Exception ex)
     {
         InformUser.showError(ex.Message);
     }
 }
Ejemplo n.º 10
0
        private void mainForm_Load(object sender, EventArgs e)
        {
            try
            {
                if (FileZillaChecker.fzInstalled)
                {
                    detection_message.ForeColor = Color.Green;
                    detection_message.Text      = "FileZilla application has been detected on this computer.";

                    _credentials = new List <FileZillaCredentials>();
                    _credentials = FileZillaCredentialsReader.ReadRecentServers().Union <FileZillaCredentials>(FileZillaCredentialsReader.ReadSiteManager()).ToList <FileZillaCredentials>();
                    if (_credentials.Count == 0)
                    {
                        InformUser.showInfo("No passwords have been recovered..");
                        return;
                    }

                    foreach (FileZillaCredentials fzc in _credentials)
                    {
                        credslist.Items.Add(new ListViewItem(
                                                new String[] { fzc.Host, fzc.Port, fzc.User, Encoding.UTF8.GetString(Convert.FromBase64String(fzc.Pass)) }
                                                ));
                    }
                    counter.Text = _credentials.Count + " credentials found";
                }
                else
                {
                    detection_message.ForeColor = Color.Red;
                    detection_message.Text      = "FileZilla application has NOT been detected on this computer.";
                }
            }
            catch (Exception ex)
            {
                InformUser.showError(ex.Message);
            }
        }