48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using BeWo.Data;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Service.ServiceImplementations;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Security.Cryptography;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
|
|
namespace Host
|
|
{
|
|
public partial class Login : Page
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
var username = Request.Form["username"];
|
|
var password = Request.Form["password"];
|
|
|
|
if (string.IsNullOrEmpty(password))
|
|
password = null;
|
|
|
|
var b = false;
|
|
try
|
|
{
|
|
var user = DAOFactory.UserDAO.FindUserByLoginName(username);
|
|
|
|
b = user.BCryptPassword == password;
|
|
}
|
|
catch(Exception exc)
|
|
{
|
|
|
|
}
|
|
|
|
if (!b)
|
|
{
|
|
System.Threading.Thread.Sleep(5000);
|
|
}
|
|
|
|
string result = b ? "True" : "False";
|
|
Response.Write(result);
|
|
Response.End();
|
|
}
|
|
}
|
|
} |