测试代码:
private void button1_Click(object sender, EventArgs e)
{
DataAccess da = new DataAccess();
if (textBox2.Text == textBox3.Text)
{ private void button1_Click(object sender, EventArgs e)
{
DataAccess da = new DataAccess();
if (textBox2.Text == textBox3.Text)
{
try
{ private void button1_Click(object sender, EventArgs e)
{
DataAccess da = new DataAccess();
if (textBox2.Text == textBox3.Text)
{
try
{
string md5ma = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile('" + textBox2.Text + "', '"MD5"');//设置MD5 32位大写 引用system.web
DataView ds = da.GetDataView("select [tb_user].* from [tb_user] where [tb_user].yhm='" + textBox1.Text + "'");
int yzczy = ds.Count;
if (yzczy == 0)
{
int xjgly = da.ExecuteCommand("insert into [tb_user](yhm,pass) values('" + textBox1.Text + "','" + md5ma + "')");
if (xjgly == 0)
{
MessageBox.Show("账号重复", "请确认");
}
else
{
MessageBox.Show("添加成功", "成功");
}
}
}
catch
{
MessageBox.Show("发生系统错误","提示");
}
}
else
{
MessageBox.Show("密码不一致","提示");
}
}再来点PHP的

