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

📄 用c#实现类似qq的简单通讯程序.htm

📁 用c#实现类似QQ的简单通讯程序
💻 HTM
📖 第 1 页 / 共 4 页
字号:
            false;<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            listenPort += new ThreadStart(this.Listen);<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; lister = new 
            Thread(listenPort);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; this.Closing += new 
            System.ComponentModel.CancelEventHandler(abortLister);<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            Initializenotifyicon();<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; //<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
            TODO: 在 InitializeComponent 调用后添加任何构造函数代码<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; //<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            }<BR>&nbsp; &nbsp; &nbsp; &nbsp; #region 初始化托盘组件<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; private void Initializenotifyicon()<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; {<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            NotifyIcon1 = new NotifyIcon();<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; NotifyIcon1.Icon = img;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; NotifyIcon1.Text = "局域网聊天程序";<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NotifyIcon1.Visible = 
            true;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            NotifyIcon1.DoubleClick += new 
            EventHandler(this.showMainForm);<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; MenuItem [] menuArray = new 
            MenuItem[3];<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            menuArray[0] = new MenuItem();<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; menuArray[0].Text = "显示主窗口";<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; menuArray[0].Click += new 
            EventHandler(this.showMainForm);<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; menuArray[0].DefaultItem = true;<BR><BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; menuArray[1] = new 
            MenuItem("-");<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; menuArray[2] = new MenuItem();<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; menuArray[2].Text = "退出";<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; menuArray[2].Click += new 
            EventHandler(this.exitSystem);<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; nMenu = new ContextMenu(menuArray);<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NotifyIcon1.ContextMenu = 
            nMenu;<BR>&nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; 
            <BR>&nbsp; &nbsp; &nbsp; &nbsp; //显示主窗口<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; private void showMainForm(object sender,System.EventArgs 
            e)<BR>&nbsp; &nbsp; &nbsp; &nbsp; {<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.WindowState = 
            System.Windows.Forms.FormWindowState.Normal; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            }<BR>&nbsp; &nbsp; &nbsp; &nbsp; //退出程序<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; private void exitSystem(object sender,System.EventArgs 
            e)<BR>&nbsp; &nbsp; &nbsp; &nbsp; {<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; NotifyIcon1.Visible = false;<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.Close();<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; }<BR>&nbsp; &nbsp; &nbsp; &nbsp; #endregion<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; /// &lt;summary&gt;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; /// 清理所有正在使用的资源。<BR>&nbsp; &nbsp; &nbsp; &nbsp; /// 
            &lt;/summary&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; protected override 
            void Dispose( bool disposing )<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            {<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( disposing 
            )<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if 
            (components != null) <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; {<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; components.Dispose();<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; base.Dispose( disposing ); &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            <BR>&nbsp; &nbsp; &nbsp; &nbsp; }<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            #region Windows 窗体设计器生成的代码<BR>&nbsp; &nbsp; &nbsp; &nbsp; /// 
            &lt;summary&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; /// 设计器支持所需的方法 - 
            不要使用代码编辑器修改<BR>&nbsp; &nbsp; &nbsp; &nbsp; /// 此方法的内容。<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; /// &lt;/summary&gt;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; private void InitializeComponent()<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; {<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.label1 = new System.Windows.Forms.Label();<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.txtIp = new 
            System.Windows.Forms.TextBox();<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.txtRecord = new 
            System.Windows.Forms.TextBox();<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.label2 = new 
            System.Windows.Forms.Label();<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtName = new 
            System.Windows.Forms.TextBox();<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.btnSend = new 
            System.Windows.Forms.Button();<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtContent = new 
            System.Windows.Forms.TextBox();<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.label3 = new 
            System.Windows.Forms.Label();<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.SuspendLayout();<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; // label1<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.label1.Location = new System.Drawing.Point(16, 232);<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.label1.Name = 
            "label1";<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.label1.Size = new System.Drawing.Size(72, 23);<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.label1.TabIndex = 
            0;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.label1.Text = "目标地址:";<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.label1.TextAlign = 
            System.Drawing.ContentAlignment.MiddleCenter;<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // txtIp<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtIp.Anchor = 
            ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left 
            | System.Windows.Forms.AnchorStyles.Right)));<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.txtIp.Location = new 
            System.Drawing.Point(80, 232);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtIp.Name = "txtIp";<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.txtIp.Size = new 
            System.Drawing.Size(200, 21);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtIp.TabIndex = 1;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.txtIp.Text = "";<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // txtRecord<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.txtRecord.Anchor = 
            ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left 
            | System.Windows.Forms.AnchorStyles.Right)));<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.txtRecord.Location = new 
            System.Drawing.Point(16, 32);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtRecord.Multiline = true;<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.txtRecord.Name = 
            "txtRecord";<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.txtRecord.ReadOnly = true;<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.txtRecord.ScrollBars = 
            System.Windows.Forms.ScrollBars.Vertical;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.txtRecord.Size = new 
            System.Drawing.Size(264, 176);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtRecord.TabIndex = 4;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.txtRecord.Text = "";<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // label2<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.label2.Location = new 
            System.Drawing.Point(24, 256);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.label2.Name = "label2";<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.label2.Size = new 
            System.Drawing.Size(48, 23);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.label2.TabIndex = 5;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.label2.Text = "呢 称:";<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.label2.TextAlign = 
            System.Drawing.ContentAlignment.MiddleCenter;<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // txtName<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.txtName.Location = new 
            System.Drawing.Point(80, 256);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtName.Name = "txtName";<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.txtName.Size = new 
            System.Drawing.Size(88, 21);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtName.TabIndex = 6;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.txtName.Text = "";<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // btnSend<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.btnSend.Location = new 
            System.Drawing.Point(200, 256);<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.btnSend.Name = "btnSend";<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.btnSend.Size = new 
            System.Drawing.Size(64, 23);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.btnSend.TabIndex = 0;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.btnSend.Text = "发 送";<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.btnSend.Click += new 
            System.EventHandler(this.btnSend_Click);<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; // txtContent<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtContent.Anchor = 
            ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom 
            | System.Windows.Forms.AnchorStyles.Left) <BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 
            System.Windows.Forms.AnchorStyles.Right)));<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.txtContent.Location = new 
            System.Drawing.Point(16, 288);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.txtContent.Multiline = true;<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.txtContent.Name = 
            "txtContent";<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.txtContent.Size = new System.Drawing.Size(264, 152);<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.txtContent.TabIndex = 
            8;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.txtContent.Text = "";<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; // label3<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            // <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.label3.Anchor = 
            ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top 
            | System.Windows.Forms.AnchorStyles.Left) <BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 
            System.Windows.Forms.AnchorStyles.Right)));<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.label3.Location = new 
            System.Drawing.Point(16, 8);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.label3.Name = "label3";<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.label3.Size = new 
            System.Drawing.Size(100, 16);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.label3.TabIndex = 9;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.label3.Text = "聊天记录:";<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.label3.TextAlign = 
            System.Drawing.ContentAlignment.MiddleLeft;<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; // MainForm<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; // <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.AutoScaleBaseSize = new System.Drawing.Size(6, 
            14);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.ClientSize = new System.Drawing.Size(292, 453);<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.Controls.Add(this.label3);<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.Controls.Add(this.txtContent);<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.Controls.Add(this.btnSend);<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.Controls.Add(this.txtName);<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.Controls.Add(this.label2);<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; this.Controls.Add(this.txtRecord);<BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            this.Controls.Add(this.txtIp);<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; this.Controls.Add(this.label1);<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.Name = "MainForm"; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.Text = "局域网聊天程序";<BR>&nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.Load += new 
            System.EventHandler(this.MainForm_Load);<BR>&nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; this.ResumeLayout(false);<BR><BR>&nbsp; 
            &nbsp; &nbsp; &nbsp; }<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            #endregion<BR>&nbsp; &nbsp; &nbsp; &nbsp; /// 
            &lt;summary&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; /// 

⌨️ 快捷键说明

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