using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using CollaborativePlatformProject.CollaborationPlatform.Entity; namespace CollaborativePlatformProject.CollaborationPlatform.Util { /// /// /// ⽂件名(File Name):    LoginUtil.cs /// /// 描述(Description):    登陆工具类 /// /// 数据表(Tables):       nothing /// /// 作者(Author):         Sun Zheng Ji /// /// ⽇期(Create Date):     2024年4月12日13:37: /// /// 修改记录(Revision History): ///     R1: ///         修改作者: ///         修改⽇期: ///         修改理由: /// /// public class LoginUtil { /// /// 用户名和密码 /// public static List UserInfos = new List(){new UserInformationEntity("1","1")}; /// /// 验证登陆 /// /// /// /// public static bool VerifyLoginMethod(string userName, string pwd) { bool success = false; foreach (var userInfo in UserInfos) { if (userInfo.UserName.Equals(userName) && userInfo.UserPwd.Equals(pwd)) { success = true; break; } } return success; } /// /// 注册 /// /// public static bool RegisterMethod(string userName, string pwd) { try { UserInfos.Add(new UserInformationEntity(userName, pwd)); } catch (Exception e) { return false; } return true; } } }