private void button_Save_Click(object sender, EventArgs e)
 {
     Conf.EnableSOCKS = checkBox_SOCKS.Checked;
     Conf.EnableHTTP  = checkBox_HTTP.Checked;
     Conf.LocalAddress_Set(textBox_Listen.Text);
     Conf.RemoteAddress_Set(textBox_Relayer.Text);
     if (EagleTunnelUser.TryParse(textBox_ID.Text + ':' + textBox_Key.Text, out EagleTunnelUser user, true))
     {
         Conf.LocalUser = user;
     }
     Conf.Save();
     button_Save.Enabled = false;
 }
Beispiel #2
0
 public static bool TryParse(string parameter, out EagleTunnelUser user)
 {
     user = null;
     if (parameter != null)
     {
         string[] args = parameter.Split(':');
         if (args.Length >= 2)
         {
             user = new EagleTunnelUser(args[0], args[1]);
             if (args.Length >= 3)
             {
                 if (int.TryParse(args[2], out int speed))
                 {
                     user.SpeedLimit = speed;
                 }
             }
             return(true);
         }
     }
     return(false);
 }