// Token: 0x060000CA RID: 202 RVA: 0x0000AD88 File Offset: 0x00008F88
 private void frmPuttySessions_Load(object sender, EventArgs e)
 {
     try
     {
         Global.readPuttySessionFromRegistry();
         for (int i = 0; i < Global.arrPuttySessionsList.Count; i++)
         {
             PuttySession puttySession = Global.arrPuttySessionsList[i] as PuttySession;
             if (puttySession.sessionHost != "")
             {
                 this.dataGridPuttySession.Rows.Add(new object[]
                 {
                     puttySession.sessionName,
                     puttySession.sessionHost
                 });
             }
         }
         if (this.dataGridPuttySession.Rows.Count > 1)
         {
             this.btCreateDatabase.Enabled = true;
         }
         else
         {
             this.btCreateDatabase.Enabled = false;
         }
     }
     catch (Exception ex)
     {
     }
 }
Пример #2
0
 // Token: 0x060000D7 RID: 215 RVA: 0x0000B8F0 File Offset: 0x00009AF0
 private void frmSession_Load(object sender, EventArgs e)
 {
     try
     {
         Global.readPuttySessionFromRegistry();
         for (int i = 0; i < Global.arrPuttySessionsList.Count; i++)
         {
             PuttySession puttySession = Global.arrPuttySessionsList[i] as PuttySession;
             if (puttySession.sessionHost == "")
             {
                 this.cmbPuttySession.Items.Add(puttySession.sessionName);
             }
         }
         this.cmbProtocol.Text     = "SSH";
         this.cmbPuttySession.Text = Global.strCreatePuttySetting;
         if (this.sess != null)
         {
             this.displayExistingValues();
         }
         if (this.txtName.Text.Trim() == "" || this.txtHost.Text.Trim() == "")
         {
             this.btOK.Enabled = false;
         }
         this.txtHost.Focus();
     }
     catch (Exception ex)
     {
     }
 }
Пример #3
0
 // Token: 0x06000153 RID: 339 RVA: 0x00012E6C File Offset: 0x0001106C
 public static void readPuttySessionFromRegistry()
 {
     try
     {
         string[]    array       = new string[2];
         RegistryKey currentUser = Registry.CurrentUser;
         RegistryKey registryKey = currentUser.OpenSubKey("Software\\SimonTatham\\PuTTY\\Sessions", true);
         string[]    array2      = new string[0];
         if (registryKey != null)
         {
             array2 = registryKey.GetSubKeyNames();
             Global.arrPuttySessionsList.Clear();
             for (int i = 0; i < array2.Count <string>(); i++)
             {
                 PuttySession puttySession = new PuttySession();
                 RegistryKey  registryKey2 = registryKey.OpenSubKey(array2[i], true);
                 puttySession.sessionName = array2[i];
                 puttySession.sessionHost = registryKey2.GetValue("HostName").ToString();
                 puttySession.protocol    = registryKey2.GetValue("Protocol").ToString();
                 puttySession.portNumber  = int.Parse(registryKey2.GetValue("PortNumber").ToString());
                 puttySession.userName    = registryKey2.GetValue("UserName").ToString();
                 if (puttySession.sessionHost.Contains("@"))
                 {
                     array = puttySession.sessionHost.Split(new char[]
                     {
                         '@'
                     });
                     puttySession.sessionHost = array[1];
                     if (puttySession.userName.Trim() == "")
                     {
                         puttySession.userName = array[0];
                     }
                 }
                 registryKey2.Close();
                 Global.arrPuttySessionsList.Add(puttySession);
             }
             registryKey.Close();
             currentUser.Close();
         }
     }
     catch (Exception ex)
     {
     }
 }