
9 changed files with 878 additions and 128 deletions
-
94XCoder/Common/ControlConfig.cs
-
4XCoder/FrmMDI.cs
-
71XCoder/Tools/FrmMD5.cs
-
68XCoder/Tools/FrmSecurity.cs
-
10XCoder/XCoder.csproj
-
220XCoder/XNet/FrmSsh.cs
-
407XCoder/XNet/FrmSsh.designer.cs
-
129XCoder/XNet/FrmSsh.resx
-
3XCoder40/XCoder40.csproj
@ -0,0 +1,94 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using System.Windows.Forms; |
|||
using NewLife; |
|||
using NewLife.Serialization; |
|||
|
|||
namespace XCoder.Common |
|||
{ |
|||
/// <summary>控件配置</summary>
|
|||
internal class ControlConfig |
|||
{ |
|||
public Control Control { get; set; } |
|||
|
|||
public String FileName { get; set; } |
|||
|
|||
public void Load() |
|||
{ |
|||
var dataPath = Setting.Current.DataPath; |
|||
var file = dataPath.CombinePath(FileName).GetFullPath(); |
|||
if (File.Exists(file)) |
|||
{ |
|||
var dic = JsonParser.Decode(File.ReadAllText(file)); |
|||
LoadConfig(dic, Control); |
|||
} |
|||
} |
|||
|
|||
private void LoadConfig(IDictionary<String, Object> dic, Control control) |
|||
{ |
|||
foreach (Control item in control.Controls) |
|||
{ |
|||
switch (item) |
|||
{ |
|||
case RadioButton rb: |
|||
if (dic.TryGetValue(item.Name, out var v)) rb.Checked = v.ToBoolean(); |
|||
break; |
|||
case CheckBox cb: |
|||
if (dic.TryGetValue(item.Name, out v)) cb.Checked = v.ToBoolean(); |
|||
break; |
|||
case RichTextBox rtb: |
|||
if (dic.TryGetValue(item.Name, out v)) rtb.Text = v + ""; |
|||
break; |
|||
case NumericUpDown nud: |
|||
if (dic.TryGetValue(item.Name, out v)) nud.Value = v.ToInt(); |
|||
break; |
|||
case ComboBox cbox: |
|||
if (dic.TryGetValue(item.Name, out v)) cbox.DataSource = (v + "").Split(","); |
|||
break; |
|||
default: |
|||
if (item.Controls.Count > 0) LoadConfig(dic, item); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
public void Save() |
|||
{ |
|||
var dic = new Dictionary<String, Object>(); |
|||
SaveConfig(dic, Control); |
|||
|
|||
var dataPath = Setting.Current.DataPath; |
|||
var file = dataPath.CombinePath(FileName).GetFullPath(); |
|||
file.EnsureDirectory(true); |
|||
File.WriteAllText(file, dic.ToJson(true)); |
|||
} |
|||
|
|||
private void SaveConfig(IDictionary<String, Object> dic, Control control) |
|||
{ |
|||
foreach (Control item in control.Controls) |
|||
{ |
|||
switch (item) |
|||
{ |
|||
case RadioButton rb: dic[item.Name] = rb.Checked; break; |
|||
case CheckBox cb: dic[item.Name] = cb.Checked; break; |
|||
case RichTextBox rtb: dic[item.Name] = rtb.Text; break; |
|||
case NumericUpDown nud: dic[item.Name] = nud.Value; break; |
|||
case ComboBox cbox: |
|||
var list = new List<String> { cbox.Text }; |
|||
for (var i = 0; i < cbox.Items.Count; i++) |
|||
{ |
|||
var elm = cbox.Items[i]; |
|||
if (elm != null) list.Add(elm + ""); |
|||
} |
|||
dic[item.Name] = list.Where(e => !e.IsNullOrEmpty()).Distinct().Join(); |
|||
break; |
|||
default: |
|||
if (item.Controls.Count > 0) SaveConfig(dic, item); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,220 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.Windows.Forms; |
|||
using NewLife; |
|||
using NewLife.Log; |
|||
using NewLife.Net; |
|||
using XCoder; |
|||
using XCoder.Common; |
|||
using XCoder.XNet; |
|||
|
|||
namespace XNet |
|||
{ |
|||
[Category("网络通信")] |
|||
[DisplayName("SSH工具")] |
|||
public partial class FrmSsh : Form, IXForm |
|||
{ |
|||
private ControlConfig _config; |
|||
ISocketClient _Client; |
|||
|
|||
#region 窗体
|
|||
public FrmSsh() |
|||
{ |
|||
InitializeComponent(); |
|||
|
|||
// 动态调节宽度高度,兼容高DPI
|
|||
this.FixDpi(); |
|||
|
|||
Icon = IcoHelper.GetIcon("SSH"); |
|||
} |
|||
|
|||
private void FrmMain_Load(Object sender, EventArgs e) |
|||
{ |
|||
_config = new ControlConfig { Control = this, FileName = "ssh.json" }; |
|||
_config.Load(); |
|||
|
|||
txtReceive.UseWinFormControl(); |
|||
txtReceive.Clear(); |
|||
txtReceive.SetDefaultStyle(12); |
|||
txtSend.SetDefaultStyle(12); |
|||
|
|||
gbReceive.Tag = gbReceive.Text; |
|||
gbSend.Tag = gbSend.Text; |
|||
|
|||
// 加载保存的颜色
|
|||
UIConfig.Apply(txtReceive); |
|||
} |
|||
#endregion
|
|||
|
|||
#region 收发数据
|
|||
void Connect() |
|||
{ |
|||
_Client = null; |
|||
|
|||
var remote = cbRemote.Text; |
|||
var uri = new NetUri(remote); |
|||
if (uri.Type == NetType.Unknown) uri.Type = NetType.Tcp; |
|||
if (uri.Port == 0) uri.Port = 22; |
|||
|
|||
var client = uri.CreateRemote(); |
|||
|
|||
client.Received += OnReceived; |
|||
client.Log = XTrace.Log; |
|||
|
|||
if (!client.Open()) return; |
|||
|
|||
_Client = client; |
|||
|
|||
"已连接服务器".SpeechTip(); |
|||
|
|||
pnlSetting.Enabled = false; |
|||
btnConnect.Text = "关闭"; |
|||
|
|||
_config.Save(); |
|||
} |
|||
|
|||
void Disconnect() |
|||
{ |
|||
if (_Client != null) |
|||
{ |
|||
_Client.Dispose(); |
|||
_Client = null; |
|||
|
|||
"关闭连接".SpeechTip(); |
|||
} |
|||
|
|||
pnlSetting.Enabled = true; |
|||
btnConnect.Text = "打开"; |
|||
} |
|||
|
|||
private void btnConnect_Click(Object sender, EventArgs e) |
|||
{ |
|||
_config.Save(); |
|||
|
|||
var btn = sender as Button; |
|||
if (btn.Text == "打开") |
|||
Connect(); |
|||
else |
|||
Disconnect(); |
|||
} |
|||
|
|||
void OnReceived(Object sender, ReceivedEventArgs e) |
|||
{ |
|||
XTrace.WriteLine(e.Packet.ToStr()); |
|||
} |
|||
|
|||
Int32 _pColor = 0; |
|||
Int32 BytesOfReceived = 0; |
|||
Int32 BytesOfSent = 0; |
|||
Int32 lastReceive = 0; |
|||
Int32 lastSend = 0; |
|||
private void timer1_Tick(Object sender, EventArgs e) |
|||
{ |
|||
var rcount = BytesOfReceived; |
|||
var tcount = BytesOfSent; |
|||
if (rcount != lastReceive) |
|||
{ |
|||
gbReceive.Text = (gbReceive.Tag + "").Replace("0", rcount + ""); |
|||
lastReceive = rcount; |
|||
} |
|||
if (tcount != lastSend) |
|||
{ |
|||
gbSend.Text = (gbSend.Tag + "").Replace("0", tcount + ""); |
|||
lastSend = tcount; |
|||
} |
|||
|
|||
var cfg = NetConfig.Current; |
|||
if (cfg.ColorLog) txtReceive.ColourDefault(_pColor); |
|||
_pColor = txtReceive.TextLength; |
|||
} |
|||
|
|||
private void btnSend_Click(Object sender, EventArgs e) |
|||
{ |
|||
var str = txtSend.Text; |
|||
if (String.IsNullOrEmpty(str)) |
|||
{ |
|||
MessageBox.Show("发送内容不能为空!", Text); |
|||
txtSend.Focus(); |
|||
return; |
|||
} |
|||
|
|||
// 处理换行
|
|||
str = str.Replace("\n", "\r\n"); |
|||
|
|||
if (_Client != null) _Client.Send(str); |
|||
} |
|||
#endregion
|
|||
|
|||
#region 右键菜单
|
|||
private void mi清空_Click(Object sender, EventArgs e) |
|||
{ |
|||
txtReceive.Clear(); |
|||
BytesOfReceived = 0; |
|||
} |
|||
|
|||
private void mi清空2_Click(Object sender, EventArgs e) |
|||
{ |
|||
txtSend.Clear(); |
|||
BytesOfSent = 0; |
|||
} |
|||
|
|||
private void mi显示应用日志_Click(Object sender, EventArgs e) |
|||
{ |
|||
var mi = sender as ToolStripMenuItem; |
|||
mi.Checked = !mi.Checked; |
|||
} |
|||
|
|||
private void mi显示网络日志_Click(Object sender, EventArgs e) |
|||
{ |
|||
var mi = sender as ToolStripMenuItem; |
|||
mi.Checked = !mi.Checked; |
|||
} |
|||
|
|||
private void mi显示发送数据_Click(Object sender, EventArgs e) |
|||
{ |
|||
var mi = sender as ToolStripMenuItem; |
|||
mi.Checked = !mi.Checked; |
|||
} |
|||
|
|||
private void mi显示接收数据_Click(Object sender, EventArgs e) |
|||
{ |
|||
var mi = sender as ToolStripMenuItem; |
|||
mi.Checked = !mi.Checked; |
|||
} |
|||
|
|||
private void mi显示统计信息_Click(Object sender, EventArgs e) |
|||
{ |
|||
var mi = sender as ToolStripMenuItem; |
|||
NetConfig.Current.ShowStat = mi.Checked = !mi.Checked; |
|||
} |
|||
|
|||
private void mi显示接收字符串_Click(Object sender, EventArgs e) |
|||
{ |
|||
var mi = sender as ToolStripMenuItem; |
|||
NetConfig.Current.ShowReceiveString = mi.Checked = !mi.Checked; |
|||
} |
|||
|
|||
private void miHex发送_Click(Object sender, EventArgs e) |
|||
{ |
|||
var mi = sender as ToolStripMenuItem; |
|||
NetConfig.Current.HexSend = mi.Checked = !mi.Checked; |
|||
} |
|||
|
|||
private void 查看Tcp参数ToolStripMenuItem_Click(Object sender, EventArgs e) |
|||
{ |
|||
NetHelper2.ShowTcpParameters(); |
|||
} |
|||
|
|||
private void 设置最大TcpToolStripMenuItem_Click(Object sender, EventArgs e) |
|||
{ |
|||
NetHelper2.SetTcpMax(); |
|||
} |
|||
|
|||
private void mi日志着色_Click(Object sender, EventArgs e) |
|||
{ |
|||
var mi = sender as ToolStripMenuItem; |
|||
mi.Checked = !mi.Checked; |
|||
} |
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,407 @@ |
|||
namespace XNet |
|||
{ |
|||
partial class FrmSsh |
|||
{ |
|||
/// <summary>
|
|||
/// 必需的设计器变量。
|
|||
/// </summary>
|
|||
private System.ComponentModel.IContainer components = null; |
|||
|
|||
/// <summary>
|
|||
/// 清理所有正在使用的资源。
|
|||
/// </summary>
|
|||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
|||
protected override void Dispose(bool disposing) |
|||
{ |
|||
if (disposing && (components != null)) |
|||
{ |
|||
components.Dispose(); |
|||
} |
|||
base.Dispose(disposing); |
|||
} |
|||
|
|||
#region Windows 窗体设计器生成的代码
|
|||
|
|||
/// <summary>
|
|||
/// 设计器支持所需的方法 - 不要
|
|||
/// 使用代码编辑器修改此方法的内容。
|
|||
/// </summary>
|
|||
private void InitializeComponent() |
|||
{ |
|||
this.components = new System.ComponentModel.Container(); |
|||
this.gbReceive = new System.Windows.Forms.GroupBox(); |
|||
this.txtReceive = new System.Windows.Forms.RichTextBox(); |
|||
this.menuReceive = new System.Windows.Forms.ContextMenuStrip(this.components); |
|||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.mi日志着色 = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); |
|||
this.mi显示应用日志 = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.mi显示网络日志 = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.mi显示接收字符串 = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.mi显示发送数据 = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.mi显示接收数据 = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.mi显示统计信息 = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator(); |
|||
this.查看Tcp参数ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.设置最大TcpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.menuSend = new System.Windows.Forms.ContextMenuStrip(this.components); |
|||
this.miHexSend = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.mi清空2 = new System.Windows.Forms.ToolStripMenuItem(); |
|||
this.btnConnect = new System.Windows.Forms.Button(); |
|||
this.timer1 = new System.Windows.Forms.Timer(this.components); |
|||
this.fontDialog1 = new System.Windows.Forms.FontDialog(); |
|||
this.colorDialog1 = new System.Windows.Forms.ColorDialog(); |
|||
this.pnlSetting = new System.Windows.Forms.Panel(); |
|||
this.cbRemote = new System.Windows.Forms.ComboBox(); |
|||
this.label4 = new System.Windows.Forms.Label(); |
|||
this.gbSend = new System.Windows.Forms.GroupBox(); |
|||
this.txtSend = new System.Windows.Forms.RichTextBox(); |
|||
this.btnSend = new System.Windows.Forms.Button(); |
|||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); |
|||
this.label1 = new System.Windows.Forms.Label(); |
|||
this.txtUser = new System.Windows.Forms.TextBox(); |
|||
this.label3 = new System.Windows.Forms.Label(); |
|||
this.textBox2 = new System.Windows.Forms.TextBox(); |
|||
this.gbReceive.SuspendLayout(); |
|||
this.menuReceive.SuspendLayout(); |
|||
this.menuSend.SuspendLayout(); |
|||
this.pnlSetting.SuspendLayout(); |
|||
this.gbSend.SuspendLayout(); |
|||
this.SuspendLayout(); |
|||
//
|
|||
// gbReceive
|
|||
//
|
|||
this.gbReceive.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
|||
| System.Windows.Forms.AnchorStyles.Left) |
|||
| System.Windows.Forms.AnchorStyles.Right))); |
|||
this.gbReceive.Controls.Add(this.txtReceive); |
|||
this.gbReceive.Location = new System.Drawing.Point(14, 64); |
|||
this.gbReceive.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.gbReceive.Name = "gbReceive"; |
|||
this.gbReceive.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.gbReceive.Size = new System.Drawing.Size(978, 351); |
|||
this.gbReceive.TabIndex = 4; |
|||
this.gbReceive.TabStop = false; |
|||
this.gbReceive.Text = "接收区:已接收0字节"; |
|||
//
|
|||
// txtReceive
|
|||
//
|
|||
this.txtReceive.ContextMenuStrip = this.menuReceive; |
|||
this.txtReceive.Dock = System.Windows.Forms.DockStyle.Fill; |
|||
this.txtReceive.HideSelection = false; |
|||
this.txtReceive.Location = new System.Drawing.Point(4, 25); |
|||
this.txtReceive.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.txtReceive.Name = "txtReceive"; |
|||
this.txtReceive.Size = new System.Drawing.Size(970, 322); |
|||
this.txtReceive.TabIndex = 1; |
|||
this.txtReceive.Text = ""; |
|||
//
|
|||
// menuReceive
|
|||
//
|
|||
this.menuReceive.ImageScalingSize = new System.Drawing.Size(24, 24); |
|||
this.menuReceive.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { |
|||
this.toolStripMenuItem1, |
|||
this.mi日志着色, |
|||
this.toolStripMenuItem3, |
|||
this.mi显示应用日志, |
|||
this.mi显示网络日志, |
|||
this.mi显示接收字符串, |
|||
this.mi显示发送数据, |
|||
this.mi显示接收数据, |
|||
this.mi显示统计信息, |
|||
this.toolStripMenuItem4, |
|||
this.查看Tcp参数ToolStripMenuItem, |
|||
this.设置最大TcpToolStripMenuItem}); |
|||
this.menuReceive.Name = "menuSend"; |
|||
this.menuReceive.Size = new System.Drawing.Size(207, 316); |
|||
//
|
|||
// toolStripMenuItem1
|
|||
//
|
|||
this.toolStripMenuItem1.Name = "toolStripMenuItem1"; |
|||
this.toolStripMenuItem1.Size = new System.Drawing.Size(206, 30); |
|||
this.toolStripMenuItem1.Text = "清空"; |
|||
this.toolStripMenuItem1.Click += new System.EventHandler(this.mi清空_Click); |
|||
//
|
|||
// mi日志着色
|
|||
//
|
|||
this.mi日志着色.Name = "mi日志着色"; |
|||
this.mi日志着色.Size = new System.Drawing.Size(206, 30); |
|||
this.mi日志着色.Text = "日志着色"; |
|||
this.mi日志着色.Click += new System.EventHandler(this.mi日志着色_Click); |
|||
//
|
|||
// toolStripMenuItem3
|
|||
//
|
|||
this.toolStripMenuItem3.Name = "toolStripMenuItem3"; |
|||
this.toolStripMenuItem3.Size = new System.Drawing.Size(203, 6); |
|||
//
|
|||
// mi显示应用日志
|
|||
//
|
|||
this.mi显示应用日志.Name = "mi显示应用日志"; |
|||
this.mi显示应用日志.Size = new System.Drawing.Size(206, 30); |
|||
this.mi显示应用日志.Text = "显示应用日志"; |
|||
this.mi显示应用日志.Click += new System.EventHandler(this.mi显示应用日志_Click); |
|||
//
|
|||
// mi显示网络日志
|
|||
//
|
|||
this.mi显示网络日志.Name = "mi显示网络日志"; |
|||
this.mi显示网络日志.Size = new System.Drawing.Size(206, 30); |
|||
this.mi显示网络日志.Text = "显示网络日志"; |
|||
this.mi显示网络日志.Click += new System.EventHandler(this.mi显示网络日志_Click); |
|||
//
|
|||
// mi显示接收字符串
|
|||
//
|
|||
this.mi显示接收字符串.Name = "mi显示接收字符串"; |
|||
this.mi显示接收字符串.Size = new System.Drawing.Size(206, 30); |
|||
this.mi显示接收字符串.Text = "显示接收字符串"; |
|||
this.mi显示接收字符串.Click += new System.EventHandler(this.mi显示接收字符串_Click); |
|||
//
|
|||
// mi显示发送数据
|
|||
//
|
|||
this.mi显示发送数据.Name = "mi显示发送数据"; |
|||
this.mi显示发送数据.Size = new System.Drawing.Size(206, 30); |
|||
this.mi显示发送数据.Text = "显示发送数据"; |
|||
this.mi显示发送数据.Click += new System.EventHandler(this.mi显示发送数据_Click); |
|||
//
|
|||
// mi显示接收数据
|
|||
//
|
|||
this.mi显示接收数据.Name = "mi显示接收数据"; |
|||
this.mi显示接收数据.Size = new System.Drawing.Size(206, 30); |
|||
this.mi显示接收数据.Text = "显示接收数据"; |
|||
this.mi显示接收数据.Click += new System.EventHandler(this.mi显示接收数据_Click); |
|||
//
|
|||
// mi显示统计信息
|
|||
//
|
|||
this.mi显示统计信息.Name = "mi显示统计信息"; |
|||
this.mi显示统计信息.Size = new System.Drawing.Size(206, 30); |
|||
this.mi显示统计信息.Text = "显示统计信息"; |
|||
this.mi显示统计信息.Click += new System.EventHandler(this.mi显示统计信息_Click); |
|||
//
|
|||
// toolStripMenuItem4
|
|||
//
|
|||
this.toolStripMenuItem4.Name = "toolStripMenuItem4"; |
|||
this.toolStripMenuItem4.Size = new System.Drawing.Size(203, 6); |
|||
//
|
|||
// 查看Tcp参数ToolStripMenuItem
|
|||
//
|
|||
this.查看Tcp参数ToolStripMenuItem.Name = "查看Tcp参数ToolStripMenuItem"; |
|||
this.查看Tcp参数ToolStripMenuItem.Size = new System.Drawing.Size(206, 30); |
|||
this.查看Tcp参数ToolStripMenuItem.Text = "查看Tcp参数"; |
|||
this.查看Tcp参数ToolStripMenuItem.Click += new System.EventHandler(this.查看Tcp参数ToolStripMenuItem_Click); |
|||
//
|
|||
// 设置最大TcpToolStripMenuItem
|
|||
//
|
|||
this.设置最大TcpToolStripMenuItem.Name = "设置最大TcpToolStripMenuItem"; |
|||
this.设置最大TcpToolStripMenuItem.Size = new System.Drawing.Size(206, 30); |
|||
this.设置最大TcpToolStripMenuItem.Text = "设置最大Tcp"; |
|||
this.设置最大TcpToolStripMenuItem.Click += new System.EventHandler(this.设置最大TcpToolStripMenuItem_Click); |
|||
//
|
|||
// menuSend
|
|||
//
|
|||
this.menuSend.ImageScalingSize = new System.Drawing.Size(24, 24); |
|||
this.menuSend.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { |
|||
this.miHexSend, |
|||
this.mi清空2}); |
|||
this.menuSend.Name = "menuSend"; |
|||
this.menuSend.Size = new System.Drawing.Size(150, 64); |
|||
//
|
|||
// miHexSend
|
|||
//
|
|||
this.miHexSend.Name = "miHexSend"; |
|||
this.miHexSend.Size = new System.Drawing.Size(149, 30); |
|||
this.miHexSend.Text = "Hex发送"; |
|||
this.miHexSend.Click += new System.EventHandler(this.miHex发送_Click); |
|||
//
|
|||
// mi清空2
|
|||
//
|
|||
this.mi清空2.Name = "mi清空2"; |
|||
this.mi清空2.Size = new System.Drawing.Size(149, 30); |
|||
this.mi清空2.Text = "清空"; |
|||
this.mi清空2.Click += new System.EventHandler(this.mi清空2_Click); |
|||
//
|
|||
// btnConnect
|
|||
//
|
|||
this.btnConnect.Location = new System.Drawing.Point(880, 14); |
|||
this.btnConnect.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.btnConnect.Name = "btnConnect"; |
|||
this.btnConnect.Size = new System.Drawing.Size(100, 44); |
|||
this.btnConnect.TabIndex = 3; |
|||
this.btnConnect.Text = "打开"; |
|||
this.btnConnect.UseVisualStyleBackColor = true; |
|||
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click); |
|||
//
|
|||
// timer1
|
|||
//
|
|||
this.timer1.Enabled = true; |
|||
this.timer1.Interval = 300; |
|||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); |
|||
//
|
|||
// pnlSetting
|
|||
//
|
|||
this.pnlSetting.Controls.Add(this.textBox2); |
|||
this.pnlSetting.Controls.Add(this.label3); |
|||
this.pnlSetting.Controls.Add(this.txtUser); |
|||
this.pnlSetting.Controls.Add(this.label1); |
|||
this.pnlSetting.Controls.Add(this.cbRemote); |
|||
this.pnlSetting.Controls.Add(this.label4); |
|||
this.pnlSetting.Location = new System.Drawing.Point(14, 12); |
|||
this.pnlSetting.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.pnlSetting.Name = "pnlSetting"; |
|||
this.pnlSetting.Size = new System.Drawing.Size(858, 46); |
|||
this.pnlSetting.TabIndex = 13; |
|||
//
|
|||
// cbRemote
|
|||
//
|
|||
this.cbRemote.FormattingEnabled = true; |
|||
this.cbRemote.Location = new System.Drawing.Point(77, 14); |
|||
this.cbRemote.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.cbRemote.Name = "cbRemote"; |
|||
this.cbRemote.Size = new System.Drawing.Size(252, 26); |
|||
this.cbRemote.TabIndex = 17; |
|||
//
|
|||
// label4
|
|||
//
|
|||
this.label4.AutoSize = true; |
|||
this.label4.Location = new System.Drawing.Point(23, 18); |
|||
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); |
|||
this.label4.Name = "label4"; |
|||
this.label4.Size = new System.Drawing.Size(44, 18); |
|||
this.label4.TabIndex = 16; |
|||
this.label4.Text = "远程"; |
|||
//
|
|||
// gbSend
|
|||
//
|
|||
this.gbSend.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) |
|||
| System.Windows.Forms.AnchorStyles.Right))); |
|||
this.gbSend.Controls.Add(this.txtSend); |
|||
this.gbSend.Controls.Add(this.btnSend); |
|||
this.gbSend.Location = new System.Drawing.Point(14, 424); |
|||
this.gbSend.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.gbSend.Name = "gbSend"; |
|||
this.gbSend.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.gbSend.Size = new System.Drawing.Size(978, 126); |
|||
this.gbSend.TabIndex = 15; |
|||
this.gbSend.TabStop = false; |
|||
this.gbSend.Text = "发送区:已发送0字节"; |
|||
//
|
|||
// txtSend
|
|||
//
|
|||
this.txtSend.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
|||
| System.Windows.Forms.AnchorStyles.Left) |
|||
| System.Windows.Forms.AnchorStyles.Right))); |
|||
this.txtSend.ContextMenuStrip = this.menuSend; |
|||
this.txtSend.HideSelection = false; |
|||
this.txtSend.Location = new System.Drawing.Point(0, 28); |
|||
this.txtSend.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.txtSend.Name = "txtSend"; |
|||
this.txtSend.Size = new System.Drawing.Size(886, 86); |
|||
this.txtSend.TabIndex = 2; |
|||
this.txtSend.Text = ""; |
|||
//
|
|||
// btnSend
|
|||
//
|
|||
this.btnSend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); |
|||
this.btnSend.Location = new System.Drawing.Point(894, 74); |
|||
this.btnSend.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.btnSend.Name = "btnSend"; |
|||
this.btnSend.Size = new System.Drawing.Size(75, 45); |
|||
this.btnSend.TabIndex = 1; |
|||
this.btnSend.Text = "发送"; |
|||
this.btnSend.UseVisualStyleBackColor = true; |
|||
this.btnSend.Click += new System.EventHandler(this.btnSend_Click); |
|||
//
|
|||
// label1
|
|||
//
|
|||
this.label1.AutoSize = true; |
|||
this.label1.Location = new System.Drawing.Point(357, 18); |
|||
this.label1.Name = "label1"; |
|||
this.label1.Size = new System.Drawing.Size(80, 18); |
|||
this.label1.TabIndex = 18; |
|||
this.label1.Text = "用户名:"; |
|||
//
|
|||
// txtUser
|
|||
//
|
|||
this.txtUser.Location = new System.Drawing.Point(441, 13); |
|||
this.txtUser.Name = "txtUser"; |
|||
this.txtUser.Size = new System.Drawing.Size(100, 28); |
|||
this.txtUser.TabIndex = 19; |
|||
this.txtUser.Text = "root"; |
|||
//
|
|||
// label3
|
|||
//
|
|||
this.label3.AutoSize = true; |
|||
this.label3.Location = new System.Drawing.Point(587, 18); |
|||
this.label3.Name = "label3"; |
|||
this.label3.Size = new System.Drawing.Size(62, 18); |
|||
this.label3.TabIndex = 20; |
|||
this.label3.Text = "密码:"; |
|||
//
|
|||
// textBox2
|
|||
//
|
|||
this.textBox2.Location = new System.Drawing.Point(644, 13); |
|||
this.textBox2.Name = "textBox2"; |
|||
this.textBox2.Size = new System.Drawing.Size(100, 28); |
|||
this.textBox2.TabIndex = 21; |
|||
this.textBox2.Text = "root"; |
|||
//
|
|||
// FrmSsh
|
|||
//
|
|||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); |
|||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
|||
this.ClientSize = new System.Drawing.Size(1000, 568); |
|||
this.Controls.Add(this.gbSend); |
|||
this.Controls.Add(this.pnlSetting); |
|||
this.Controls.Add(this.btnConnect); |
|||
this.Controls.Add(this.gbReceive); |
|||
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); |
|||
this.Name = "FrmSsh"; |
|||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; |
|||
this.Text = "SSH工具"; |
|||
this.Load += new System.EventHandler(this.FrmMain_Load); |
|||
this.gbReceive.ResumeLayout(false); |
|||
this.menuReceive.ResumeLayout(false); |
|||
this.menuSend.ResumeLayout(false); |
|||
this.pnlSetting.ResumeLayout(false); |
|||
this.pnlSetting.PerformLayout(); |
|||
this.gbSend.ResumeLayout(false); |
|||
this.ResumeLayout(false); |
|||
|
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
private System.Windows.Forms.GroupBox gbReceive; |
|||
private System.Windows.Forms.Button btnConnect; |
|||
private System.Windows.Forms.Timer timer1; |
|||
private System.Windows.Forms.ContextMenuStrip menuSend; |
|||
private System.Windows.Forms.ToolStripMenuItem mi清空2; |
|||
private System.Windows.Forms.RichTextBox txtReceive; |
|||
private System.Windows.Forms.FontDialog fontDialog1; |
|||
private System.Windows.Forms.ColorDialog colorDialog1; |
|||
private System.Windows.Forms.Panel pnlSetting; |
|||
private System.Windows.Forms.ContextMenuStrip menuReceive; |
|||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; |
|||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; |
|||
private System.Windows.Forms.GroupBox gbSend; |
|||
private System.Windows.Forms.RichTextBox txtSend; |
|||
private System.Windows.Forms.Button btnSend; |
|||
private System.Windows.Forms.ToolStripMenuItem mi显示发送数据; |
|||
private System.Windows.Forms.ToolStripMenuItem mi显示接收数据; |
|||
private System.Windows.Forms.ToolStripMenuItem mi显示统计信息; |
|||
private System.Windows.Forms.ToolStripMenuItem mi显示接收字符串; |
|||
private System.Windows.Forms.ToolStripMenuItem mi显示应用日志; |
|||
private System.Windows.Forms.ToolStripMenuItem mi显示网络日志; |
|||
private System.Windows.Forms.ToolTip toolTip1; |
|||
private System.Windows.Forms.ToolStripMenuItem miHexSend; |
|||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4; |
|||
private System.Windows.Forms.ToolStripMenuItem 查看Tcp参数ToolStripMenuItem; |
|||
private System.Windows.Forms.ToolStripMenuItem 设置最大TcpToolStripMenuItem; |
|||
private System.Windows.Forms.ToolStripMenuItem mi日志着色; |
|||
private System.Windows.Forms.ComboBox cbRemote; |
|||
private System.Windows.Forms.Label label4; |
|||
private System.Windows.Forms.TextBox textBox2; |
|||
private System.Windows.Forms.Label label3; |
|||
private System.Windows.Forms.TextBox txtUser; |
|||
private System.Windows.Forms.Label label1; |
|||
} |
|||
} |
|||
|
@ -0,0 +1,129 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<root> |
|||
<!-- |
|||
Microsoft ResX Schema |
|||
|
|||
Version 2.0 |
|||
|
|||
The primary goals of this format is to allow a simple XML format |
|||
that is mostly human readable. The generation and parsing of the |
|||
various data types are done through the TypeConverter classes |
|||
associated with the data types. |
|||
|
|||
Example: |
|||
|
|||
... ado.net/XML headers & schema ... |
|||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|||
<resheader name="version">2.0</resheader> |
|||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|||
</data> |
|||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|||
<comment>This is a comment</comment> |
|||
</data> |
|||
|
|||
There are any number of "resheader" rows that contain simple |
|||
name/value pairs. |
|||
|
|||
Each data row contains a name, and value. The row also contains a |
|||
type or mimetype. Type corresponds to a .NET class that support |
|||
text/value conversion through the TypeConverter architecture. |
|||
Classes that don't support this are serialized and stored with the |
|||
mimetype set. |
|||
|
|||
The mimetype is used for serialized objects, and tells the |
|||
ResXResourceReader how to depersist the object. This is currently not |
|||
extensible. For a given mimetype the value must be set accordingly: |
|||
|
|||
Note - application/x-microsoft.net.object.binary.base64 is the format |
|||
that the ResXResourceWriter will generate, however the reader can |
|||
read any of the formats listed below. |
|||
|
|||
mimetype: application/x-microsoft.net.object.binary.base64 |
|||
value : The object must be serialized with |
|||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
|||
: and then encoded with base64 encoding. |
|||
|
|||
mimetype: application/x-microsoft.net.object.soap.base64 |
|||
value : The object must be serialized with |
|||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|||
: and then encoded with base64 encoding. |
|||
|
|||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|||
value : The object must be serialized into a byte array |
|||
: using a System.ComponentModel.TypeConverter |
|||
: and then encoded with base64 encoding. |
|||
--> |
|||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
|||
<xsd:element name="root" msdata:IsDataSet="true"> |
|||
<xsd:complexType> |
|||
<xsd:choice maxOccurs="unbounded"> |
|||
<xsd:element name="metadata"> |
|||
<xsd:complexType> |
|||
<xsd:sequence> |
|||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|||
</xsd:sequence> |
|||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
|||
<xsd:attribute name="type" type="xsd:string" /> |
|||
<xsd:attribute name="mimetype" type="xsd:string" /> |
|||
<xsd:attribute ref="xml:space" /> |
|||
</xsd:complexType> |
|||
</xsd:element> |
|||
<xsd:element name="assembly"> |
|||
<xsd:complexType> |
|||
<xsd:attribute name="alias" type="xsd:string" /> |
|||
<xsd:attribute name="name" type="xsd:string" /> |
|||
</xsd:complexType> |
|||
</xsd:element> |
|||
<xsd:element name="data"> |
|||
<xsd:complexType> |
|||
<xsd:sequence> |
|||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|||
</xsd:sequence> |
|||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
|||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|||
<xsd:attribute ref="xml:space" /> |
|||
</xsd:complexType> |
|||
</xsd:element> |
|||
<xsd:element name="resheader"> |
|||
<xsd:complexType> |
|||
<xsd:sequence> |
|||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|||
</xsd:sequence> |
|||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|||
</xsd:complexType> |
|||
</xsd:element> |
|||
</xsd:choice> |
|||
</xsd:complexType> |
|||
</xsd:element> |
|||
</xsd:schema> |
|||
<resheader name="resmimetype"> |
|||
<value>text/microsoft-resx</value> |
|||
</resheader> |
|||
<resheader name="version"> |
|||
<value>2.0</value> |
|||
</resheader> |
|||
<resheader name="reader"> |
|||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|||
</resheader> |
|||
<resheader name="writer"> |
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|||
</resheader> |
|||
<metadata name="menuReceive.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
|||
<value>104, 13</value> |
|||
</metadata> |
|||
<metadata name="menuSend.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
|||
<value>237, 17</value> |
|||
</metadata> |
|||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
|||
<value>601, 17</value> |
|||
</metadata> |
|||
</root> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue