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

📄 config.cs

📁 visual c# 网络编程技术与实践实例包括几个源码
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;

namespace 五子棋
{
	/// <summary>
	/// Config 的摘要说明。
	/// </summary>
	public class Config : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Button scanIPbutton;
		private System.Windows.Forms.TextBox textBox1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Button Linkbutton;
		private string ip="";
		public string IP
		{
			get{return ip;}
			set{ip=value;}
		}
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

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

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

		/// <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.label1 = new System.Windows.Forms.Label();
			this.scanIPbutton = new System.Windows.Forms.Button();
			this.textBox1 = new System.Windows.Forms.TextBox();
			this.label2 = new System.Windows.Forms.Label();
			this.Linkbutton = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(24, 16);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(192, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "本机IP:";
			// 
			// scanIPbutton
			// 
			this.scanIPbutton.Location = new System.Drawing.Point(240, 8);
			this.scanIPbutton.Name = "scanIPbutton";
			this.scanIPbutton.Size = new System.Drawing.Size(88, 32);
			this.scanIPbutton.TabIndex = 1;
			this.scanIPbutton.Text = "扫描IP";
			this.scanIPbutton.Click += new System.EventHandler(this.scanIPbutton_Click);
			// 
			// textBox1
			// 
			this.textBox1.Location = new System.Drawing.Point(80, 64);
			this.textBox1.Name = "textBox1";
			this.textBox1.Size = new System.Drawing.Size(136, 21);
			this.textBox1.TabIndex = 2;
			this.textBox1.Text = "202.115.22.";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(24, 72);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(52, 16);
			this.label2.TabIndex = 3;
			this.label2.Text = "对方IP:";
			// 
			// Linkbutton
			// 
			this.Linkbutton.Location = new System.Drawing.Point(240, 56);
			this.Linkbutton.Name = "Linkbutton";
			this.Linkbutton.Size = new System.Drawing.Size(88, 32);
			this.Linkbutton.TabIndex = 4;
			this.Linkbutton.Text = "确定";
			this.Linkbutton.Click += new System.EventHandler(this.Linkbutton_Click);
			// 
			// Config
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(368, 102);
			this.Controls.Add(this.Linkbutton);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.textBox1);
			this.Controls.Add(this.scanIPbutton);
			this.Controls.Add(this.label1);
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "Config";
			this.Text = "Config";
			this.Load += new System.EventHandler(this.Config_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void Config_Load(object sender, System.EventArgs e)
		{
			
			this.label1.Text += NetWork.getmyIP();
		}

		private void scanIPbutton_Click(object sender, System.EventArgs e)
		{
			ScanIP scan=new ScanIP();
			scan.Show();
		}

		private void Linkbutton_Click(object sender, System.EventArgs e)
		{
			ip=this.textBox1.Text;
			this.Hide();
		}
	}
}

⌨️ 快捷键说明

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