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

📄 form2.cs

📁 C常用算法程序集,一部比较经典的程序算法合集
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Net;
using System.Net.Sockets;
namespace mychat1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
        string myownip = null;

        private void button1_Click(object sender, EventArgs e)
        {
           
            if (textBox1.Text == "" || textBox2.Text == "")
            {

                MessageBox.Show("请输入完整服务器的信息!");
                return ;
            }    
     
            commonmethod .serverip  = textBox1.Text;
            commonmethod.port = Convert.ToInt32(textBox2.Text);

            try
            {
                commonmethod.sendtoserver(textBox3.Text + ":我上线了!",out myownip);
                          
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message, "提示!", MessageBoxButtons.OK);
                return;
            }

            Form main = new Form1 (textBox3 .Text,myownip );
            main.Show();
            this.Hide();

        }

        private void button2_Click(object sender, EventArgs e)
        {
            Application.Exit();

        }

       
    }
}

⌨️ 快捷键说明

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