国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

C#窗體程序連接SQL Server數(shù)據(jù)庫(kù)實(shí)現(xiàn)賬號(hào)登錄、賬號(hào)注冊(cè)、修改密碼、賬號(hào)注銷(xiāo)和實(shí)名認(rèn)證(不定時(shí)更新)

這篇具有很好參考價(jià)值的文章主要介紹了C#窗體程序連接SQL Server數(shù)據(jù)庫(kù)實(shí)現(xiàn)賬號(hào)登錄、賬號(hào)注冊(cè)、修改密碼、賬號(hào)注銷(xiāo)和實(shí)名認(rèn)證(不定時(shí)更新)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

這是本人用Visual Studio2019做的一個(gè)C#窗體登錄程序,如標(biāo)題所示,它包含了賬號(hào)登錄、注冊(cè)賬號(hào)、修改密碼、注銷(xiāo)賬號(hào)和實(shí)名認(rèn)證五個(gè)功能。對(duì)于有一定基礎(chǔ)知識(shí)的小伙伴來(lái)說(shuō),應(yīng)該不算太難,里面有注釋說(shuō)明,可能咋一看感覺(jué)代碼運(yùn)行的邏輯有點(diǎn)亂,不過(guò)沒(méi)關(guān)系,相信對(duì)你會(huì)有所幫助。以下是詳細(xì)的操作過(guò)程。

一、配置數(shù)據(jù)庫(kù)文件和程序代碼

1、由于這個(gè)登錄程序連接了SQL Server數(shù)據(jù)庫(kù),所以需要配置一下相關(guān)數(shù)據(jù),創(chuàng)建一個(gè)“賬號(hào)登錄”數(shù)據(jù)庫(kù),新建一個(gè)“登錄注冊(cè)表”和“實(shí)名信息表”,并記住這個(gè)服務(wù)器名稱(chēng),等下會(huì)用到,如下圖所示。

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


登錄注冊(cè)表設(shè)置兩個(gè)列名:username(賬號(hào))和password(密碼)以及對(duì)應(yīng)的數(shù)據(jù)類(lèi)型(可自定義)。

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


實(shí)名信息表要設(shè)置3個(gè)列名,分別是:username(賬號(hào))、Name(姓名)、IDcard(身份證號(hào))。設(shè)置username列名是為了關(guān)聯(lián)這兩張表。

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享

SQL查詢(xún)顯示結(jié)果,password和userpwd(即username+password)均顯示為密文;如果賬號(hào)未實(shí)名,則Name和IDcard兩欄沒(méi)有數(shù)據(jù)。

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享

2、然后打開(kāi)VS2019,新建一個(gè)窗體程序(我新建的窗體是CT12),在里面設(shè)置一下App.config的SQL數(shù)據(jù)庫(kù)連接信息,如下圖所示。

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享

App.config里面的代碼格式:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
	</startup>
	<connectionStrings>
		<add name="sqlserver" connectionString="server=SQLEXPRESS;database=賬號(hào)登錄;integrated security = true;"/>
		//這是以windows身份驗(yàn)證登錄連接,SQLEXPRESS是服務(wù)器名稱(chēng),“賬號(hào)登錄”是新建的數(shù)據(jù)庫(kù)名稱(chēng).
	</connectionStrings>
</configuration>

二、配置C#窗體控件布局和源代碼

該登錄程序包含了6個(gè)窗體,分別為:Form1——登錄界面、Form2——注冊(cè)界面、Form3——主界面、Form4——修改密碼界面、Form5——賬號(hào)注銷(xiāo)界面、Form6——實(shí)名認(rèn)證界面。

這里還要新創(chuàng)建一個(gè)公共類(lèi)Encrypt1.cs,在這些窗體中都會(huì)調(diào)用到。

using System;
using System.Security.Cryptography;
using System.Text;

namespace CT12
{
    class Encrypt1
    {
        public  string EncryptPassword(string userpwd)
        {
            byte[] saltBytes = Encoding.UTF8.GetBytes(userpwd); // 自定義鹽值,用于固定加密結(jié)果
            byte[] passwordBytes = Encoding.UTF8.GetBytes(userpwd + Convert.ToBase64String(saltBytes));
            byte[] hashedBytes;
            using (SHA256 sha256 = SHA256.Create())
            {
                hashedBytes = sha256.ComputeHash(passwordBytes);
            }
            string hashedPassword = Convert.ToBase64String(hashedBytes);
            int length = hashedPassword.Length;
            if (length % 2 == 0) // 如果加密后的密碼長(zhǎng)度為偶數(shù),則(加密后的密碼長(zhǎng)度/2)并輸出
            {
                hashedPassword = hashedPassword.Substring(0, length / 2);
            }
            else // 如果為奇數(shù),則(加密后的密碼-1)/2并輸出
            {
                hashedPassword = hashedPassword.Substring(0, (length - 1) / 2);
            }
            return hashedPassword;
        }
    }
}


注意:由于連接了SQL數(shù)據(jù)庫(kù),這5個(gè)窗體之間數(shù)據(jù)相互傳遞、相互關(guān)聯(lián),如果只截取一段窗體代碼運(yùn)行,則會(huì)直接報(bào)錯(cuò)。

1、窗體Form1:賬號(hào)登錄界面

label1——賬號(hào),label2——密碼,
textBox1——對(duì)應(yīng)賬號(hào)輸入,textBox2——對(duì)應(yīng)密碼輸入,
button1——登錄,button2——重置,
button3——退出,button4——注冊(cè)。
checkBox1——是否顯示密碼

窗體Form1的控件布局:

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享

窗體Form1源代碼

using System;
using System.Configuration;
using System.Data.SqlClient;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;

namespace CT12
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.Text = "賬號(hào)登錄";
            ScreenSize();
            textBox2.PasswordChar = '*';//密碼顯示為"*"
        }

        public void ScreenSize()    //設(shè)置窗體樣式和居中顯示
        {
            int x = Screen.GetBounds(this).Width;
            int y = Screen.GetBounds(this).Height;
            this.MinimumSize = new Size(x / 2, y / 2);
            this.MaximumSize = new Size(x / 2, y / 2);
            this.CenterToParent();
            this.CenterToScreen();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            ScreenSize();   //調(diào)用函數(shù)
            this.ActiveControl = textBox1;  //焦點(diǎn)在控件textBox1上面
        }

        private void Button4_Click(object sender, EventArgs e) //跳轉(zhuǎn)注冊(cè)界面
        {
            this.Hide();
            Form2 sd = new Form2();
            sd.Show();
        }

        private void Button2_Click(object sender, EventArgs e)      //重置登錄信息
        {
            textBox1.Text = "";
            textBox2.Text = "";
            this.ActiveControl = textBox1;
        }

        private void button3_Click(object sender, EventArgs e)//強(qiáng)制退出窗體程序
        {
            Process.GetCurrentProcess().Kill();
        }

        private static readonly string Stu = ConfigurationManager.ConnectionStrings["sqlserver"].ConnectionString;     //創(chuàng)建數(shù)據(jù)庫(kù)連接

        public static string username;  //設(shè)置Form1的一個(gè)參數(shù),登錄成功后將顯示在主界面Form3
        public static string password;

        private void Button1_Click(object sender, EventArgs e)  //登錄代碼
        {
            Encrypt1 SHA256 = new Encrypt1();//調(diào)用該加密類(lèi)
            if (textBox1.Text.Equals(""))
            {
                MessageBox.Show("賬號(hào)不得為空!", "提示");
                this.ActiveControl = textBox1;
            }
            else if (textBox2.Text.Equals(""))
            {
                MessageBox.Show("密碼不得為空!", "提示");
                this.ActiveControl = textBox2;
            }
            else
            {
                using (SqlConnection conn = new SqlConnection(Stu))
                {
                    conn.Open();
                    string sql = "select count(*) from 登錄注冊(cè)表 where username=@username";
                    SqlCommand cmd = new SqlCommand(sql, conn);
                    cmd.Parameters.AddWithValue("@username", textBox1.Text.Trim());
                    int count = Convert.ToInt32(cmd.ExecuteScalar());
                    if (count <= 0)
                    {
                        DialogResult dr = MessageBox.Show("賬號(hào)不存在,是否選擇注冊(cè)一個(gè)新賬號(hào)?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                        if (dr == DialogResult.OK)
                        {
                            this.Hide();
                            Form2 er = new Form2();
                            er.Show();
                            conn.Close();
                        }
                        else
                        {
                            textBox1.Text = "";
                            textBox2.Text = "";
                            this.ActiveControl = textBox1;
                        }
                        return;
                    }
                    // 驗(yàn)證用戶(hù)密碼
                    sql = "SELECT COUNT(1) FROM 登錄注冊(cè)表 WHERE username=@username AND password=@password";
                    cmd = new SqlCommand(sql, conn);
                    cmd.Parameters.AddWithValue("@username", textBox1.Text.Trim());
                    cmd.Parameters.AddWithValue("@password", SHA256.EncryptPassword(textBox1.Text.Trim()+textBox2.Text.Trim()));
                    count = Convert.ToInt32(cmd.ExecuteScalar());
                    if (count <= 0)
                    {
                        MessageBox.Show("賬號(hào)密碼錯(cuò)誤!");
                        textBox2.Text = "";
                        return;
                    }
                    // 賬號(hào)登錄成功
                    MessageBox.Show("登錄成功!");
                    username = textBox1.Text.Trim();       //將textBox1的值賦給參數(shù)username
                    password = textBox2.Text.Trim();        //將textBox2的值賦給參數(shù)password
                    conn.Close();
                    this.Hide();
                    Form3 sd = new Form3();
                    sd.Show();         //顯示主界面Form3
                }
            }
        }

        private void CheckBox1_CheckedChanged(object sender, EventArgs e)   //是否顯示密碼輸入為“*”
        {
            if (checkBox1.Checked)
            {
                textBox2.PasswordChar = '\0';
            }
            else
            {
                textBox2.PasswordChar = '*';
            }
        }

        protected override void OnClosing(CancelEventArgs e)
        {
            Process.GetCurrentProcess().Kill();
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            Process.GetCurrentProcess().Kill();
        }     
    }
}


窗體Form1運(yùn)行效果截圖

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


2、窗體Form2:賬號(hào)注冊(cè)界面

label1——新用戶(hù)名,label2——用戶(hù)密碼,label3——確認(rèn)密碼
textBox1(對(duì)應(yīng)新用戶(hù)名),textBox2(對(duì)應(yīng)用戶(hù)密碼),textBox3(對(duì)應(yīng)確認(rèn)密碼)
button1——確認(rèn),button2——重置,button3——返回

窗體Form2的控件布局

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享

窗體Form2源代碼

using System;
using System.ComponentModel;
using System.Configuration;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;

namespace CT12
{
   public partial class Form2 : Form
    {
      public Form2()
        {
            InitializeComponent();
            this.Text = "賬號(hào)注冊(cè)";
            ScreenSize();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            ScreenSize();
            textBox2.PasswordChar = '*';    //textBox2——用戶(hù)密碼顯示為"*"
            textBox3.PasswordChar = '*';    //textBox3——確認(rèn)密碼顯示為"*"
            this.ActiveControl = textBox1;  //焦點(diǎn)在輸入框textBox1上
        }

       private void ScreenSize()    //設(shè)置窗體大小尺寸和居中顯示
        {
            int x = Screen.GetBounds(this).Width;       //獲取屏幕寬度
            int y = Screen.GetBounds(this).Height;      //獲取屏幕高度
            this.MinimumSize = new Size(x / 2, y / 2);      //設(shè)置窗口最小尺寸
            this.MaximumSize = new Size(x / 2, y / 2);      //設(shè)置窗口最大尺寸
            this.CenterToParent();
            this.CenterToScreen();
        }

        private void Button2_Click(object sender, EventArgs e)  //重置輸入框信息
        {
            textBox1.Text = "";
            textBox2.Text = "";
            textBox3.Text = "";
            this.ActiveControl = textBox1;
        }

        private void Button3_Click(object sender, EventArgs e)  //返回登錄界面Form1
        {
            this.Hide();
            Form1 sd = new Form1();
            sd.Show();
        }

        readonly string Stu = ConfigurationManager.ConnectionStrings["sqlserver"].ConnectionString;

        private void Button1_Click(object sender, EventArgs e)
        {
            Encrypt1 SHA256 = new Encrypt1();
            if (textBox1.Text.Equals(""))
            {
                MessageBox.Show("注冊(cè)賬號(hào)不得為空!", "提示");
            }
            else if (textBox2.Text.Equals(""))
            {
                MessageBox.Show("注冊(cè)賬號(hào)密碼不得為空!", "提示");
            }
            else if (textBox3.Text.Equals("") || !textBox2.Text.Equals(textBox3.Text))
            {
                MessageBox.Show("請(qǐng)重新確認(rèn)密碼", "提示");
                textBox2.Text = "";
                textBox3.Text = "";
            }
            /*else if(textBox1.Text.Length<8)
            {
                MessageBox.Show("請(qǐng)輸入8位以上的新用戶(hù)名!", "提示");
                textBox1.Text = "";
            }
            else if (Regex.IsMatch(textBox2.Text.ToString(), @"^\w+_$") == false&&(textBox2.Text.Length<8||textBox2.Text.Length>16))
            {
                MessageBox.Show("請(qǐng)輸入8~16位由字母、數(shù)字和下劃線(xiàn)組成的密碼!");
                textBox2.Text = "";
                textBox3.Text = "";
            }*/
            else
            {
                using (SqlConnection conn = new SqlConnection(Stu))
                {
                    conn.Open();
                    SqlCommand command = new SqlCommand
                    {
                        Connection = conn,
                        CommandText = "SELECT COUNT(*) FROM 登錄注冊(cè)表 WHERE username = @username"
                    };
                    command.Parameters.AddWithValue("@username", textBox1.Text.Trim());
                    int count = (int)command.ExecuteScalar();
                    if (count > 0)
                    {
                        MessageBox.Show("賬號(hào)已注冊(cè)!");
                        textBox1.Text = "";
                        textBox2.Text = "";
                        textBox3.Text = "";
                        this.ActiveControl = textBox1;
                        return;
                    }
                    conn.Close();
                }

                using (SqlConnection connection = new SqlConnection(Stu))
                {
                    try
                    {
                        connection.Open();
                        SqlCommand command = new SqlCommand
                        {
                            Connection = connection,
                            CommandText = "INSERT INTO 登錄注冊(cè)表 (username, password) VALUES (@username, @password)"
                        };
                        command.Parameters.AddWithValue("@username", textBox1.Text);
                        command.Parameters.AddWithValue("@password", SHA256.EncryptPassword(textBox1.Text.Trim()+textBox2.Text.Trim()));
                        command.ExecuteNonQuery();
                        MessageBox.Show("賬號(hào)注冊(cè)成功!");
                        this.Hide();
                        Form1 sd = new Form1();
                        sd.Show();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }

        private void CheckBox1_CheckedChanged(object sender, EventArgs e)   //textBox2文本框輸入顯示為"*"
        {
            if (checkBox1.Checked)
                textBox2.PasswordChar = '\0';
            else
                textBox2.PasswordChar = '*';
        }

        private void CheckBox2_CheckedChanged(object sender, EventArgs e)   //textBox3文本框輸入為"*"
        {
            if (checkBox2.Checked)
                textBox3.PasswordChar = '\0';
            else
                textBox3.PasswordChar = '*';
        }

        protected override void OnClosing(CancelEventArgs e)
        {
            Process.GetCurrentProcess().Kill();
        }

        private void Form2_FormClosing(object sender, FormClosingEventArgs e)
        {
            Process.GetCurrentProcess().Kill();
        }
    }
}


窗體Form2運(yùn)行效果截圖

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


3、窗體Form3:主界面

checkBox1——當(dāng)前賬號(hào),Label1——顯示賬號(hào)
textBox1——顯示姓名,textBox2——顯示身份證號(hào)
Button1——修改密碼,Button2——注銷(xiāo)賬號(hào),Button5——實(shí)名認(rèn)證,
Button3——返回,Button4——退出

窗體Form3的控件布局

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享

窗體Form3的源代碼

using System;
using System.ComponentModel;
using System.Configuration;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;

namespace CT12
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
            this.Text = "賬號(hào)信息";
            ScreenSize();
        }

        public void ScreenSize()
        {
            int x = Screen.GetBounds(this).Width;
            int y = Screen.GetBounds(this).Height;
            this.MinimumSize = new Size(x / 2, y / 2);
            this.MaximumSize = new Size(x / 2, y / 2);
            this.CenterToParent();
            this.CenterToScreen();
        }

        private void Form3_Load(object sender, EventArgs e)
        {
            ScreenSize();
            ShowUser(Form1.username);
            this.HideDcard(Form1.username);
            ShowName();
        }

        public void ShowName()//在主界面顯示實(shí)名信息
        {
            using (SqlConnection conn = new SqlConnection(Stu))
            {
                // 打開(kāi)連接
                conn.Open();
                // 查詢(xún)?cè)撡~戶(hù)是否實(shí)名認(rèn)證
                string query = "SELECT Name, IDcard FROM 實(shí)名信息表 WHERE username = @username ";
                using (SqlCommand command = new SqlCommand(query, conn))
                {
                    command.Parameters.AddWithValue("@username", Form1.username);
                    SqlDataReader reader = command.ExecuteReader();
                    if (reader.Read())
                    {
                        // 如果已經(jīng)實(shí)名認(rèn)證,則顯示姓名
                        textBox2.Text = reader["Name"].ToString();
                    }
                    else
                    {
                        textBox2.Text = "";
                    }
                    reader.Close();
                }
            }
        }

        private void Button1_Click(object sender, EventArgs e)  //跳轉(zhuǎn)窗體Form4:修改密碼界面
        {
            this.Hide();
            Form4 df = new Form4();
            df.Show();
        }

        private void Button2_Click(object sender, EventArgs e)  //跳轉(zhuǎn)窗體Form5:注銷(xiāo)賬號(hào)界面
        {
            this.Hide();
            Form5 sd = new Form5();
            sd.Show();
        }

        private void Button4_Click(object sender, EventArgs e)  //強(qiáng)制退出所有窗口程序和線(xiàn)程
        {
            Process.GetCurrentProcess().Kill();
        }

        private void Button3_Click(object sender, EventArgs e)  //返回窗體Form1:登錄界面
        {
            DialogResult dr = MessageBox.Show("是否返回登錄界面?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
            if (dr == DialogResult.Yes)
            {
                this.Hide();
                Form1 sdd = new Form1();
                sdd.Show();
            }
        }

        private void Button5_Click_1(object sender, EventArgs e)
        {
            this.Hide();
            Form6 asd = new Form6();
            asd.Show();
        }

        public void ShowUser(string text)
        {
            char StarChar = '*';
            string value = text;
            int startlen = 1, endlen = 1;
            int lenth = value.Length - startlen - endlen;
            string str1 = value.Substring(startlen, lenth);
            string str2 = string.Empty;
            for (int i = 0; i < str1.Length; i++)
            {
                str2 += StarChar;
            }
            label1.Text = value.Replace(str1, str2);
        }

        public static readonly string Stu = ConfigurationManager.ConnectionStrings["sqlserver"].ConnectionString;

        private void CheckBox1_CheckedChanged(object sender, EventArgs e)   //是否顯示賬號(hào)
        {
            if (checkBox1.Checked)
            {
                label1.Text = Form1.username;
            }
            else
            {
                ShowUser(Form1.username);   //調(diào)用方法顯示*號(hào)
            }
        }

        private void CheckBox2_CheckedChanged(object sender, EventArgs e)       //是否顯示身份證號(hào)
        {
            SqlConnection con = new SqlConnection(Stu);
            con.Open();
            SqlCommand cmd = con.CreateCommand();
            cmd.CommandText = "select Name,IDcard from 實(shí)名信息表 where username='" + Form1.username + "'";
            SqlDataReader reader = cmd.ExecuteReader();
            if (reader.Read())
            {
                if (checkBox2.Checked)
                {
                    textBox2.Text = reader.GetString(reader.GetOrdinal("Name"));
                    ShowIDcard(Form1.username);  //調(diào)用方法函數(shù),顯示完整身份證號(hào)
                }
                else
                {
                    HideDcard(Form1.username);  //顯示加密后的身份證號(hào)
                }
            }
            con.Close();
        }

        public  void ShowIDcard(string text)  //顯示完整的實(shí)名信息
        {
            SqlConnection conn = new SqlConnection(Stu);
            conn.Open();
            SqlCommand cmd = conn.CreateCommand();
            cmd.CommandText = "select Name,IDcard from 實(shí)名信息表 where username='" + text + "'";
            SqlDataReader reader = cmd.ExecuteReader();
            if (reader.Read() )
            {
                textBox3.Text = reader.GetString(reader.GetOrdinal("IDcard"));
            }
            conn.Close();
        }

        public void HideDcard(string text)  //用'*'號(hào)加密身份證號(hào)
        {
            SqlConnection conn = new SqlConnection(Stu);
            conn.Open();
            SqlCommand cmd = conn.CreateCommand();
            cmd.CommandText = "select Name,IDcard from 實(shí)名信息表 where username='" + text + "'";
            SqlDataReader reader = cmd.ExecuteReader();
            if (reader.Read())
            {
                string sdd = "*";
                string IDcard = reader.GetString(reader.GetOrdinal("IDcard"));
                for (int i = 0; i < IDcard.Length - 3; i++)
                {
                    sdd += "*";
                }
                textBox3.Text = IDcard.Substring(0, 1) + sdd + IDcard.Substring(IDcard.Length - 2, 2);
            }
            else
            {
                textBox3.Text = "";
            }
            conn.Close();
        }

        private void Form3_FormClosing(object sender, FormClosingEventArgs e)
        {
            Process.GetCurrentProcess().Kill();
        }

        protected override void OnClosing(CancelEventArgs e)
        {
            Process.GetCurrentProcess().Kill();
        }
    }
}



窗體Form3界面效果截圖

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


4、窗體Form4:修改密碼界面

label2——舊密碼,label3——新密碼
textBox2(對(duì)應(yīng)舊密碼),textBox3(對(duì)應(yīng)新密碼)
Button1——確認(rèn),Button2——重置,Button3——取消

窗體Form4的控件布局

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享

窗體Form4的源代碼

using System;
using System.Configuration;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;

namespace CT12
{
    public partial class Form4 : Form
    {
        public Form4()
        {
            InitializeComponent();
            this.Text = "修改密碼";
            ScreenSize();
        }

      private void ScreenSize()
        {
            int x = Screen.GetBounds(this).Width;
            int y = Screen.GetBounds(this).Height;
            this.MinimumSize = new Size(x / 2, y / 2);
            this.MaximumSize = new Size(x / 2, y / 2);
            this.CenterToParent();
            this.CenterToScreen();
        }

        private void Form4_Load(object sender, EventArgs e)
        {
            ScreenSize();
            textBox2.PasswordChar = '*';
            textBox3.PasswordChar = '*';
            this.ActiveControl = textBox2;
        }

        private void Button3_Click(object sender, EventArgs e)  //返回窗體Form3:主界面
        {
            this.Hide();
            Form3 df = new Form3();
            df.Show();
        }

        private void Button2_Click(object sender, EventArgs e)  //重置textBox文本框的輸入信息
        {
            this.ActiveControl = textBox2;
            textBox2.Text = "";
            textBox3.Text = "";
        }

        private readonly string Stu = ConfigurationManager.ConnectionStrings["sqlserver"].ConnectionString;  //創(chuàng)建數(shù)據(jù)庫(kù)連接

        private void Button1_Click(object sender, EventArgs e)
        {
            Encrypt1 SHA256 = new Encrypt1();
            string oldPassword = textBox2.Text.Trim();//舊密碼
            string newPassword = textBox3.Text.Trim();//新密碼
            using (SqlConnection conn = new SqlConnection(Stu))
            {
                conn.Open();
                string sql = "SELECT password FROM 登錄注冊(cè)表 WHERE username=@username";
                using (SqlCommand cmd = new SqlCommand(sql, conn))
                {
                    cmd.Parameters.AddWithValue("@username", Form1.username);
                    object result = cmd.ExecuteScalar();
                    // 判斷密碼是否正確
                    if (result != null && result.ToString() == SHA256.EncryptPassword(Form1.username + oldPassword))
                    {
                        // 判斷新舊密碼是否相同
                        if (oldPassword != newPassword)
                        {
                            // 更新密碼
                            sql = "update 登錄注冊(cè)表 set password=@password WHERE username=@username";
                            using (SqlCommand updateCmd = new SqlCommand(sql, conn))
                            {
                                updateCmd.Parameters.AddWithValue("@password", SHA256.EncryptPassword(Form1.username + newPassword));
                                updateCmd.Parameters.AddWithValue("@username", Form1.username);
                                int rowsAffected = updateCmd.ExecuteNonQuery();
                                // 提示密碼修改成功
                                MessageBox.Show("賬號(hào)密碼修改成功!請(qǐng)重新登錄!");
                                this.Hide();
                                Form1 sd = new Form1();
                                sd.Show();
                                conn.Close();
                            }
                        }
                        else
                        {
                            MessageBox.Show("新舊密碼不得相同!");
                            textBox2.Text = "";
                            textBox3.Text = "";
                            this.ActiveControl = textBox2;
                        }
                    }
                    else
                    {
                        MessageBox.Show("賬號(hào)密碼錯(cuò)誤!");
                        textBox2.Text = "";
                        textBox3.Text = "";
                        this.ActiveControl = textBox2;
                    }
                }
            }
        }

        private void CheckBox1_CheckedChanged(object sender, EventArgs e)   //textBox2文本框輸入是否顯示為"*"
        {
            if (checkBox1.Checked)
            {
                textBox2.PasswordChar = '\0';
            }
            else
            {
                textBox2.PasswordChar = '*';
            }
        }

        private void CheckBox2_CheckedChanged(object sender, EventArgs e)   // //textBox3文本框輸入是否顯示為"*"
        {
            if (checkBox1.Checked)
            {
                textBox3.PasswordChar = '\0';
            }
            else
            {
                textBox3.PasswordChar = '*';
            }
        }

        private void Form4_FormClosing(object sender, FormClosingEventArgs e)
        {
            Process.GetCurrentProcess().Kill();
        }
    }
}


窗體Form4運(yùn)行效果截圖

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


5、窗體Form5:賬號(hào)注銷(xiāo)界面

label2——賬號(hào)密碼,textBox2——對(duì)應(yīng)當(dāng)前賬號(hào)密碼,
button1——注銷(xiāo),button2——重置,button3——取消

窗體Form5的控件布局

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享

窗體Form5的源代碼

using System;
using System.Configuration;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;

namespace CT12
{
    public partial class Form5 : Form
    {
        public Form5()
        {
            InitializeComponent();
            this.Text = "賬號(hào)注銷(xiāo)";
            ScreenSize();
        }

        public void ScreenSize()
        {
            int x = Screen.GetBounds(this).Width;
            int y = Screen.GetBounds(this).Height;
            this.MinimumSize = new Size(x / 2, y / 2);
            this.MaximumSize = new Size(x / 2, y / 2);
            this.CenterToParent();
            this.CenterToScreen();
        }

        private void Form5_Load(object sender, EventArgs e)
        {
            ScreenSize();
            this.ActiveControl = textBox2;
        }

        private void Button3_Click(object sender, EventArgs e)  //返回窗體Form3:主界面
        {
            this.Hide();
            Form3 sd = new Form3();
            sd.Show();
        }

        private void Button2_Click(object sender, EventArgs e)  //重置textBox文本框的信息
        {
            textBox2.Text = "";
            this.ActiveControl = textBox2;
        }

        private readonly string Stu = ConfigurationManager.ConnectionStrings["sqlserver"].ConnectionString;

        private void Button1_Click(object sender, EventArgs e)  //賬號(hào)注銷(xiāo)功能
        {
            Encrypt1 SHA256 = new Encrypt1();
            using (SqlConnection conn = new SqlConnection(Stu))
            {
                conn.Open();
                SqlCommand command = new SqlCommand("SELECT COUNT(*) FROM 登錄注冊(cè)表 WHERE username=@username AND password=@password", conn);
                command.Parameters.AddWithValue("@username", Form1.username); // 賬號(hào)使用 Form1 中的 username
                command.Parameters.AddWithValue("@password", SHA256.EncryptPassword(Form1.username+textBox2.Text));
                int count = (int)command.ExecuteScalar();
                if (count == 1) // 如果存在該賬號(hào)且密碼正確
                {
                    try
                    {
                        // 構(gòu)建 SQL 刪除語(yǔ)句,刪除該賬號(hào)和密碼
                        SqlCommand deleteCommand = new SqlCommand("DELETE FROM 登錄注冊(cè)表 WHERE username=@username AND password=@password", conn);
                        deleteCommand.Parameters.AddWithValue("@username", Form1.username); // 使用 form1 中的 username
                        deleteCommand.Parameters.AddWithValue("@password", SHA256.EncryptPassword(Form1.username+textBox2.Text));
                        deleteCommand.ExecuteNonQuery();
                        MessageBox.Show("賬號(hào)注銷(xiāo)成功!");
                        Delete2();//同時(shí)刪除實(shí)名信息的數(shù)據(jù)
                        this.Hide();
                        Form1 sd = new Form1();
                        sd.Show();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("賬號(hào)注銷(xiāo)失敗!" + ex.Message);
                    }
                
                }
                else
                {
                    MessageBox.Show("賬號(hào)密碼錯(cuò)誤!");
                    textBox2.Text = "";
                    this.ActiveControl = textBox2;
                }
            }
        }

       private void Delete2()      //刪除注銷(xiāo)賬號(hào)的實(shí)名信息
        {
            using (SqlConnection conn = new SqlConnection(Stu))
            {
                conn.Open();
                try
                {
                    // 構(gòu)建 SQL 刪除語(yǔ)句,刪除該賬號(hào)和密碼
                    SqlCommand deleteCommand = new SqlCommand("delete from 實(shí)名信息表 where username=@username", conn);
                    deleteCommand.Parameters.AddWithValue("@username", Form1.username); // 使用 form1 中的 username
                    deleteCommand.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("賬號(hào)注銷(xiāo)失??!" + ex.Message);
                }
                conn.Close();
            }
        }

        private void Form5_FormClosing(object sender, FormClosingEventArgs e)
        {
            Process.GetCurrentProcess().Kill();
        }
    }
}


6、窗體Form6:實(shí)名認(rèn)證界面

label1——姓名,label2——身份證號(hào)
textBox1——對(duì)應(yīng)姓名,textBox2——對(duì)應(yīng)身份證號(hào)
button1——綁定,button2——重置,button3——返回

窗體Form6的控件布局

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享

窗體Form6源代碼

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing;
using System.Security.Cryptography;
using System.Text;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;

namespace CT12
{
    public partial class Form6 : Form
    {
        public Form6()
        {
            InitializeComponent();
            this.Text = "實(shí)名認(rèn)證";
            ScreenSize();
        }

        private void Form6_Load(object sender, EventArgs e)
        {
            ScreenSize();
        }

        public void ScreenSize()
        {
            int x = Screen.GetBounds(this).Width;
            int y = Screen.GetBounds(this).Height;
            this.MinimumSize = new Size(x / 2, y / 2);
            this.MaximumSize = new Size(x / 2, y / 2);
            this.CenterToParent();
            this.CenterToScreen();
        }
        private void Button3_Click(object sender, EventArgs e)
        {
            this.Hide();
            Form3 sd = new Form3();
            sd.Show();
        }

        private void Button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            textBox2.Text = "";
        }

        public string MD5Encrypt(string rawPass, string salt)      //MD5加鹽加密
        {
            MD5 md5 = MD5.Create();
            byte[] bs = Encoding.UTF8.GetBytes(rawPass + salt);
            byte[] ts = md5.ComputeHash(bs);
            StringBuilder std = new StringBuilder();
            foreach (byte i in ts)
            {
                std.Append(i.ToString("x2"));
            }
            return std.ToString();  //返回密文
        }

       public static readonly string Stu = ConfigurationManager.ConnectionStrings["sqlserver"].ConnectionString;

        public static string name;  //創(chuàng)建參數(shù)name,實(shí)名認(rèn)證成功后顯示在主界面Form3
        public static string IDcard;    //創(chuàng)建參數(shù)IDcard,實(shí)名認(rèn)證成功后顯示在主界面Form3

        private void Button1_Click(object sender, EventArgs e)      //綁定操作
        {
            SqlConnection conn = new SqlConnection(Stu);
            conn.Open();
            // 查詢(xún)?cè)撡~號(hào)是否已經(jīng)實(shí)名認(rèn)證過(guò)
            string sqlQuery = $"SELECT COUNT(*) FROM 實(shí)名信息表 WHERE username='{Form1.username}'";
            SqlCommand cmdQuery = new SqlCommand(sqlQuery, conn);
            int count = (int)cmdQuery.ExecuteScalar();
            if (count > 0)
            {
                MessageBox.Show("該賬號(hào)已實(shí)名認(rèn)證");
            }
            else
            {
                // 查詢(xún)?cè)撋矸葑C號(hào)是否已被其他人注冊(cè)
                string sqlCheckID = $"SELECT COUNT(*) FROM 實(shí)名信息表 WHERE IDcard='{textBox2.Text.Trim()}'";
                SqlCommand cmdCheckID = new SqlCommand(sqlCheckID, conn);
                int idCount = (int)cmdCheckID.ExecuteScalar();
                if (idCount > 0)
                {
                    MessageBox.Show("該身份證已經(jīng)被別人注冊(cè)");
                }
                else
                {
                    try
                    {
                        // 綁定實(shí)名認(rèn)證賬號(hào)
                        string sqlInsert = $"INSERT INTO 實(shí)名信息表 (username, Name, IDcard) VALUES ('{Form1.username}', '{textBox1.Text.Trim()}', '{textBox2.Text.Trim()}')";
                        SqlCommand cmdInsert = new SqlCommand(sqlInsert, conn);
                        cmdInsert.ExecuteNonQuery();
                        conn.Close();
                        MessageBox.Show("實(shí)名認(rèn)證成功!");
                        this.Hide();
                        Form1 sd = new Form1();
                        sd.Show();
                    }
                    catch(Exception ex)
                    {
                        MessageBox.Show("實(shí)名認(rèn)證失?。? + ex.Message);
                    }
                }
            }
            conn.Close(); // 關(guān)閉數(shù)據(jù)庫(kù)連接
        }

        private void Form6_FormClosing(object sender, FormClosingEventArgs e)
        {
            Process.GetCurrentProcess().Kill();
        }
    }
}




Form6運(yùn)行效果截圖

c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


c#連接數(shù)據(jù)庫(kù)界面,c#,服務(wù)器,數(shù)據(jù)庫(kù),c語(yǔ)言,經(jīng)驗(yàn)分享


總結(jié)

以上就是今天要跟大家分享的內(nèi)容,可能代碼有點(diǎn)多,代碼邏輯看起來(lái)比較亂,花了幾個(gè)星期時(shí)間寫(xiě)的,期間修修改改了很多次,尚且還有不足之處,僅供學(xué)習(xí)和參考;感興趣的小伙伴可以來(lái)看看,希望對(duì)你有所幫助,也歡迎大家的批評(píng)指正。

本人聲明:未經(jīng)本人許可,禁止轉(zhuǎn)載?。?!如果要引用部分代碼,請(qǐng)標(biāo)明出處?。?/strong>文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-787042.html

到了這里,關(guān)于C#窗體程序連接SQL Server數(shù)據(jù)庫(kù)實(shí)現(xiàn)賬號(hào)登錄、賬號(hào)注冊(cè)、修改密碼、賬號(hào)注銷(xiāo)和實(shí)名認(rèn)證(不定時(shí)更新)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶(hù)投稿,該文觀(guān)點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Sql server 連接 Oracle數(shù)據(jù)庫(kù)

    Sql server 連接 Oracle數(shù)據(jù)庫(kù)

    前提預(yù)警:本機(jī)必須裝有Oracle客戶(hù)端 檢查是否安裝Oracle客戶(hù)端,并檢查T(mén)NS信息是否配置完成 1.1、 在cmd中執(zhí)行 sqlplus ,沒(méi)有報(bào)錯(cuò)并出現(xiàn)Oracle版本號(hào),則表示Oracle已安裝 1.2、配置TNS信息(最上面的10.0.0.130可隨意定義,eg:test、orcl、qerghasd…) 配置ODBC數(shù)據(jù)信息 2.1、打開(kāi)ODBC數(shù)據(jù)

    2024年02月03日
    瀏覽(20)
  • Navicat連接SQL Server數(shù)據(jù)庫(kù)

    使用navicat連接sqlserver數(shù)據(jù)庫(kù)時(shí)必須連接sqlserver驅(qū)動(dòng),否則的話(huà)會(huì)連接報(bào)錯(cuò); 按照應(yīng)用的常理來(lái)說(shuō)都是高版本兼容低版本的驅(qū)動(dòng); 我這邊呢,是一個(gè)SQL Server Native Client 11.0的驅(qū)動(dòng); 大家需要的話(huà)可以到SQL Server官網(wǎng)網(wǎng)址去下載各類(lèi)驅(qū)動(dòng); 網(wǎng)址:https://docs.microsoft.com/en-us/sql/con

    2024年02月08日
    瀏覽(25)
  • 通過(guò)Java連接Sql Server數(shù)據(jù)庫(kù)

    通過(guò)Java連接Sql Server數(shù)據(jù)庫(kù)

    JDBC是Java DateBase Connectivity的簡(jiǎn)寫(xiě),翻譯過(guò)來(lái)就是java連接數(shù)據(jù)庫(kù),或者更通俗地說(shuō)就是java語(yǔ)言操作數(shù)據(jù)庫(kù)。JDBC的本質(zhì)其實(shí)是官方定義的一套操作所有關(guān)系型數(shù)據(jù)庫(kù)的規(guī)則,也就是接口。 微軟官方j(luò)dbc下載地址:https://www.microsoft.com/zh-cn/download/details.aspx?id=11774 下載之后解壓到相

    2024年01月17日
    瀏覽(96)
  • ado庫(kù)——連接sql server數(shù)據(jù)庫(kù)

    頭文件 database.h cpp文件

    2024年02月16日
    瀏覽(26)
  • 【遠(yuǎn)程連接 多個(gè)SQL SERVER數(shù)據(jù)庫(kù)實(shí)例】

    【遠(yuǎn)程連接 多個(gè)SQL SERVER數(shù)據(jù)庫(kù)實(shí)例】

    在公司電腦上同時(shí)安裝了SQL SERVER2012和SQL SERVER2019,分別設(shè)置了不同的實(shí)例,現(xiàn)用VPN連接公司電腦上的兩個(gè)數(shù)據(jù)庫(kù)實(shí)例,做一些記錄。 如圖所示,分別有MSSQLSERVER2012與MSSQLSERVER2019兩個(gè)不同的實(shí)例,分別查看實(shí)例對(duì)應(yīng)的TCP/IP 為數(shù)據(jù)庫(kù)引擎訪(fǎng)問(wèn)配置 Windows 防火墻 - SQL Server | Micro

    2024年02月07日
    瀏覽(27)
  • 連接數(shù)據(jù)庫(kù)報(bào)com.microsoft.sqlserver.jdbc.SQLServerException: 驅(qū)動(dòng)程序無(wú)法通過(guò)使用安全套接字層(SSL)加密與 SQL Server 建立安全連接

    連接數(shù)據(jù)庫(kù)報(bào)com.microsoft.sqlserver.jdbc.SQLServerException: 驅(qū)動(dòng)程序無(wú)法通過(guò)使用安全套接字層(SSL)加密與 SQL Server 建立安全連接

    JDBC加載驅(qū)動(dòng),連接SQLServer 2012 報(bào) java.ext.dirs: C:Program FilesJavajdk1.8.0_331jrelibext;C:WindowsSunJavalibext com.microsoft.sqlserver.jdbc.SQLServerException: 驅(qū)動(dòng)程序無(wú)法通過(guò)使用安全套接字層(SSL)加密與 SQL Server 建立安全連接。錯(cuò)誤:“The server selected protocol version TLS10 is not accepted by client pre

    2023年04月21日
    瀏覽(98)
  • 【SQL Server】無(wú)需公網(wǎng)IP,就可以遠(yuǎn)程連接SQL Server數(shù)據(jù)庫(kù)

    【SQL Server】無(wú)需公網(wǎng)IP,就可以遠(yuǎn)程連接SQL Server數(shù)據(jù)庫(kù)

    目錄 1.前言 2.本地安裝和設(shè)置SQL Server 2.1 SQL Server下載 2.2 SQL Server本地連接測(cè)試 2.3 Cpolar內(nèi)網(wǎng)穿透的下載和安裝 2.3 Cpolar內(nèi)網(wǎng)穿透的注冊(cè) 3.本地網(wǎng)頁(yè)發(fā)布 3.1 Cpolar云端設(shè)置 3.2 Cpolar本地設(shè)置 4.公網(wǎng)訪(fǎng)問(wèn)測(cè)試 5.結(jié)語(yǔ) 數(shù)據(jù)庫(kù)的重要性相信大家都有所了解,作為各種數(shù)據(jù)的電子資料夾,

    2023年04月24日
    瀏覽(26)
  • C# 連接SQL Sever 數(shù)據(jù)庫(kù)

    C# 連接SQL Sever 數(shù)據(jù)庫(kù)

    獲取服務(wù)器名,用戶(hù)名,密碼以及你要訪(fǎng)問(wèn)的數(shù)據(jù)庫(kù) 1.新建一個(gè)項(xiàng)目(控制臺(tái)應(yīng)用) 2. 引入相關(guān)命名空間 3.訪(fǎng)問(wèn)數(shù)據(jù)庫(kù) 我的數(shù)據(jù)庫(kù)的信息: 服務(wù)器名 :DESKTOP-56DN3HD 登錄名 :Csharp 密碼 :123456 數(shù)據(jù)庫(kù)名 :LibraryManagementSystem 方法一 方法二 (1)是數(shù)據(jù)源服務(wù)器 (2)是要訪(fǎng)問(wèn)的數(shù)據(jù)

    2024年02月08日
    瀏覽(26)
  • python連接sql?server數(shù)據(jù)庫(kù)(pyodbc)

    python連接sql?server數(shù)據(jù)庫(kù)(pyodbc)

    用python操作ms?sql?server,有好幾種方法: (1)利用pymssql (2)利用pyodbc 這里講import?pyodbc來(lái)操作sql?server?database。 pyodbc是Python包,使用ODBC驅(qū)動(dòng)器來(lái)連接SQL Server數(shù)據(jù)庫(kù),其中pyodbc的基本類(lèi)型是Connection,Cursor、Row 其中,Connection表示客戶(hù)端和數(shù)據(jù)庫(kù)的連接,并用于提交事務(wù);

    2024年02月01日
    瀏覽(25)
  • python連接Microsoft SQL Server 數(shù)據(jù)庫(kù)

    python連接Microsoft SQL Server 數(shù)據(jù)庫(kù)

    ? python代碼 ?

    2024年02月11日
    瀏覽(31)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包