Register.cs
(开头部分) 10KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Security.Cryptography;
using MySql.Data.MySqlClient;
namespace BBS
{
public partial class Register : Form
{
// 定义全局变量
public static string pathPicture; // 定义全局变量,用于存放头像图片路径
public Byte[] mybyte = new byte[0]; // 用于存取图片二进制数据
public Register()
{
InitializeComponent();
}
private void Register_Load(object sender, EventArgs e)
{
// 窗体初始化设置
// 输入框内容为空
textBox_username.Text = "";
textBox_phone.Text = "";
textBox_email.Text = "";
textBox_password.Text = "";
// 错误提示tip不可见
label_username_tip.Visible = false;
label_phone_tip.Visible = false;
label_email_tip.Visible = false;
label_password_tip.Visible = false;
}
// MD5加密算法
private string EncryptWithMD5(string source)//MD5加密
{
byte[] sor = Encoding.UTF8.GetBytes(source);
MD5 md5 = MD5.Create();
byte[] result = md5.ComputeHash(sor);
StringBuilder strbul = new StringBuilder(40);
for (int i = 0; i < result.Length; i++)
{
strbul.Append(result[i].ToString("x2"));//加密结果"x2"结果为32位,"x3"结果为48位,"x4"结果为64位
}
return strbul.ToString();
}
private void pictureBox_avatar_Click(object sender, EventArgs e)
{
//设置文件对话框显示的初始目录为系统桌面
this.openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
后面还有 163 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
