Form1.cs
上传用户:szltgg
上传日期:2019-05-16
资源大小:604k
文件大小:2k
源码类别:

Telnet服务器

开发平台:

C#

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using Poderosa.Terminal;
  9. namespace C_Sharp_Usage_Eample
  10. {
  11.     public partial class Form1 : Form
  12.     {
  13.         public Form1()
  14.         {
  15.             InitializeComponent();
  16.         }
  17.         private void button1_Click(object sender, EventArgs e)
  18.         {
  19.             this.terminalControl1.UserName = this.usertextBox3.Text;
  20.             this.terminalControl1.Password = this.passtextBox2.Text;
  21.             this.terminalControl1.Host = this.servertextBox1.Text;
  22.             this.terminalControl1.Method = WalburySoftware.ConnectionMethod.SSH2;
  23.             this.terminalControl1.Connect();
  24.             this.terminalControl1.SetPaneColors(Color.Blue, Color.Black);
  25.             this.terminalControl1.Focus();
  26.         }
  27.         private void button2_Click(object sender, EventArgs e)
  28.         {
  29.             if (this.terminalControl1.TerminalPane.ConnectionTag == null) // it will be null if you're not connected to anything
  30.                 return;
  31.             Poderosa.Forms.EditRenderProfile dlg = new Poderosa.Forms.EditRenderProfile(this.terminalControl1.TerminalPane.ConnectionTag.RenderProfile);
  32.             
  33.             if (dlg.ShowDialog() != DialogResult.OK)
  34.                 return;
  35.             this.terminalControl1.TerminalPane.ConnectionTag.RenderProfile = dlg.Result;
  36.             this.terminalControl1.TerminalPane.ApplyRenderProfile(dlg.Result);
  37.             
  38.         }
  39.         
  40.     }
  41. }