📄 class1.cs~rf277040.tmp
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
namespace DAL
{
public class Class1
{
public bool GetInfo(string strusername,string struserpwd)
{
SqlConnection a1 = connectionDB.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='" + strusername + "' and UserPassword='" + userpwd + "'";
SqlCommand cm = new SqlCommand(str, cn2);
return Ac2.getuserlaber(username, userpwd);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -