📄 zhuce.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.Data.SqlClient;
namespace pwxt
{
public partial class zhuce : Form
{
public zhuce()
{
InitializeComponent();
}
static int k=0;
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
k++;
string selectstr = "Insert into USertable(xuhao,name,pasd) values ('" + k.ToString() + "','" + this.textBox1.Text + "','" + this.textBox2.Text + "')";
SqlConnection sconn = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["connectionstring"]);
SqlCommand scmd = new SqlCommand(selectstr, sconn);
sconn.Open();
int EXENum = scmd.ExecuteNonQuery();
if (EXENum == 1)
MessageBox.Show("注册成功");
else
MessageBox.Show("注册失败");
sconn.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -