- ©«¤l
- 20
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 35
- ÂI¦W
- 1
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- excel 2010
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2025-1-7
- ³Ì«áµn¿ý
- 2025-1-16
|
private bool AuthenticateUser(string username, string password)
{
//¹ê²{§Aªº±b±KÅçÃÒÅÞ¿è
//return username == "admin" && password == "1234";
#region
SqlConnection cn_webform = new SqlConnection();
cn_webform.ConnectionString = "server=192.168.1.1;database=DBXYZ;User ID=sa;Password=123456789;Trusted_Connection=False;";
cn_webform.Open();
string strSQL = "SELECT COUNT(*), F002 FROM USERFILE WITH (NOLOCK) WHERE F001 = '" + username + "' AND F058 = '" + password + "' AND F022='' GROUP BY F002";
SqlCommand sqlcmd = new SqlCommand(strSQL, cn_webform);
SqlDataReader sqlreader = sqlcmd.ExecuteReader();
if (sqlreader.Read())
{
MainFormOpen.LoginAction(username, sqlreader[1].ToString().Trim());
cn_webform.Close();
return true;
}
else
{
cn_webform.Close();
return false;
}
#endregion
} |
|