示例#1
0
 /// <summary>
 /// Creates a connection from a GUI to the bot
 /// </summary>
 /// <param name="token">The token that specifies how to connect to the bot</param>
 public Connection(Listener.LogDelegate log, Token token)
 {
     this.log = log;
     State = ConnectionState.Connecting;
     worker = new Thread(new ParameterizedThreadStart(client_Connect));
     worker.Start(token);
 }
示例#2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         ConnectToken = Token.FromXML(textBox1.Text);
         DialogResult = System.Windows.Forms.DialogResult.OK;
     }
     catch (Exception ex)
     {
         MessageBox.Show("The entered connection token is not valid, please check the token\n\nAdditional information: " + ex.Message, "Bad token");
     }
 }
示例#3
0
 public ConnectDialog(Token token)
 {
     InitializeComponent();
     textBox1.Text = token.ToXML();
 }
示例#4
0
文件: Token.cs 项目: vsrz/desbot_vsrz
 /// <summary>
 /// Returns a token valid for the local host only
 /// </summary>
 /// <returns>Token identifying localhost</returns>
 public static Token LocalHostToken()
 {
     Token result = new Token();
     result.IP = "127.0.0.1";
     return result;
 }