/// <summary> /// 生成Xml文件 /// </summary> /// <param name="loginInfo"></param> private void Create_Xml(List <UserInfo> loginInfo) { var tList = new List <UserInfo>(); foreach (var item in loginInfo) { tList.Add(new UserInfo { AutomaticLogon = item.AutomaticLogon, RememberPwd = item.RememberPwd, UserName = CryptInfoHelper.GetEncrypt(item.UserName), UserPwd = CryptInfoHelper.GetEncrypt(item.UserPwd), Tid = item.Tid }); } XmlSerializer xmls = new XmlSerializer(tList.GetType()); if (InfoFile.Exists) { InfoFile.Delete(); } using (Stream s = InfoFile.OpenWrite()) { xmls.Serialize(s, tList); //s.Close(); } }
public void ChangePassword(string oldpwd, string newpwd) { Execute(new UserChangePasswordRequest { Id = DataFactory.Instance.GetCacheHashtable().Get(CacheHashkey.UserId), OldPwd = CryptInfoHelper.GetEncrypt(oldpwd), NewPwd = CryptInfoHelper.GetEncrypt(newpwd) }); }
public long Save(long id, string userName, string password) { var rsp = Execute(new UserSaveRequest { Id = id, UserName = userName, PassWord = CryptInfoHelper.GetEncrypt(password) }); return(rsp.id); }
public void Login(long tid, string userName, string password) { UserRequest request = new UserRequest(); request.UserName = userName; request.PassWord = CryptInfoHelper.GetEncrypt(password); request.Tid = tid; var rsp = Execute(request); DataFactory.Instance.GetCacheHashtable().Set(CacheHashkey.UserId, rsp.UserId); DataFactory.Instance.GetCacheHashtable().Set(CacheHashkey.UserName, rsp.UserName); DataFactory.Instance.GetCacheHashtable().Set(CacheHashkey.Token, rsp.Token); }