📄 registation.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.Net;
namespace SQ
{
public partial class Registation : Form
{
private ToolTip Tips;
private int im=0;
public Registation()
{
InitializeComponent();
this.components = new Container();
Tips = new ToolTip(this.components);
tips();
}
private void tips()
{
this.Tips.SetToolTip(this.textBox1, "任意昵称");
this.Tips.SetToolTip(this.textBox2, "大于4少于16的密码");
this.Tips.SetToolTip(this.textBox3, "再次输入相同的密码");
this.Tips.SetToolTip(this.button1, "选取头像");
}
private void button1_Click(object sender, EventArgs e)
{
picture p = new picture(this);
p.ShowDialog();
}
public void getImage(int im) {
this.im = im;
this.pictureBox1.Image =image.imageListLarge.Images[im];
}
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
if (!textBox1.Text.Equals("") && !textBox2.Text.Equals("") && !textBox3.Text.Equals(""))
{
if (textBox2.Text.Length >= 4 && textBox2.Text.Length <= 16)
{
if (textBox2.Text.Equals(textBox3.Text))
{
IPAddress[] ips = Dns.GetHostAddresses(Dns.GetHostName());
connect con = new connect(ips[0], 7788);
con.Writer("0000:"+this.textBox1.Text+":"+this.textBox2.Text+":"+im);
string str = con.Reader();
MessageBox.Show(str);
con.Close();
this.Close();
}
else {
MessageBox.Show("两次输入的密码不相同!");
}
}
else {
MessageBox.Show("请输入大于并少于16的密码!");
}
}
else {
MessageBox.Show("请完全填写!");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -