⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmconnect.cs

📁 自定义协议
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Text;


namespace CodeManager
{
	/// <summary>
	/// FrmConnect 的摘要说明。
	/// </summary>
	public class FrmConnect : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Button connect;

		private MainForm theApp;
		private System.Windows.Forms.Button cancel;
		private System.Windows.Forms.TextBox tbFolder;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public FrmConnect(MainForm mf)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
			theApp = mf;
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.label1 = new System.Windows.Forms.Label();
			this.tbFolder = new System.Windows.Forms.TextBox();
			this.cancel = new System.Windows.Forms.Button();
			this.connect = new System.Windows.Forms.Button();
			this.groupBox1.SuspendLayout();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.tbFolder);
			this.groupBox1.Controls.Add(this.cancel);
			this.groupBox1.Controls.Add(this.connect);
			this.groupBox1.Location = new System.Drawing.Point(16, 8);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(216, 88);
			this.groupBox1.TabIndex = 6;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "新建文件夹";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 24);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(72, 24);
			this.label1.TabIndex = 10;
			this.label1.Text = "文件夹名称";
			// 
			// tbFolder
			// 
			this.tbFolder.Location = new System.Drawing.Point(88, 24);
			this.tbFolder.Name = "tbFolder";
			this.tbFolder.Size = new System.Drawing.Size(116, 21);
			this.tbFolder.TabIndex = 0;
			this.tbFolder.Text = "";
			// 
			// cancel
			// 
			this.cancel.Location = new System.Drawing.Point(120, 56);
			this.cancel.Name = "cancel";
			this.cancel.Size = new System.Drawing.Size(88, 23);
			this.cancel.TabIndex = 2;
			this.cancel.Text = "取  消";
			this.cancel.Click += new System.EventHandler(this.cancel_Click);
			// 
			// connect
			// 
			this.connect.Location = new System.Drawing.Point(8, 56);
			this.connect.Name = "connect";
			this.connect.Size = new System.Drawing.Size(88, 24);
			this.connect.TabIndex = 1;
			this.connect.Text = "确  定";
			this.connect.Click += new System.EventHandler(this.connect_Click);
			// 
			// FrmConnect
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(250, 111);
			this.Controls.Add(this.groupBox1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Name = "FrmConnect";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "新建文件夹";
			this.groupBox1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void cancel_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void connect_Click(object sender, System.EventArgs e)
		{
			try
			{
				if ( "" == tbFolder.Text )
				{
					MessageBox.Show("新建文件夹不能为空!");
					return;
				}
				theApp.ParseCMSG_SendPacket(defcmd.MKD, Encoding.GetEncoding(936).GetBytes(String.Format("{0}\n",tbFolder.Text)));
				tbFolder.Focus();

			}
			catch(Exception ep)
			{
				MainForm.logs("[connect_Click]error:" + ep.Message);
				return;
			}
		
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -