⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class1.cs~rf268cc6.tmp

📁 数据配置信息 登录数据库为sa 密码123 登录界面的用户信息:shichang 密码:sc
💻 TMP
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;

namespace DAL
{
    public class Class1
    {
        public  SqlConnection getcn()
        {
            SqlConnection cn = new SqlConnection("server=.;database=ClassSay;uid=sa;pwd=123");
           
        }
         public bool GetInfo(string strusername,string struserpwd)
         {
             SqlConnection a1 = Class1.getcn();
             a1.Open();
             string str = "select Count(*) from ClassUserID where UserName='" + strusername + "' and UserPassword='" + struserpwd + "'";
             SqlCommand cm = new SqlCommand(str, a1);
             return ((int)cm.ExecuteScalar()!=0);
             a1.Close();
             
             
         }
        public string getuserlaber(string strusername, string userpwd)
        {

            SqlConnection cn1 = new SqlConnection("server=.;database=ClassSay;uid=sa;pwd=123");
            cn1.Open();
            string str = "select UserLable from ClassUserID where UserName='" + strusername + "' and UserPassword='" + userpwd + "'"; 
            SqlCommand cm = new SqlCommand(str, cn1);
            return cm.ExecuteScalar().ToString();
            cn1.Close();

        }

        public bool updateuser(string username, string userpwd, string userlaber, string userimage)
        {
            SqlConnection cn2 = new SqlConnection("server=.;database=ClassSay;uid=sa;pwd=123");
            cn2.Open();
            string str = "select UserLable from ClassUserID where UserName='" + username + "' and UserPassword='" + userpwd + "'";
            SqlCommand cm = new SqlCommand(str, cn2);
            return Ac2.getuserlaber(username, userpwd);
        }
       
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -