示例#1
0
        public IUser GetUser(string username, string password)
        {
            var user = new XmlUser();

            user.UserName = username;
            user.Password = password;
            return(user);
        }
示例#2
0
        public void AddUser(string username, string password)
        {
            var xmlUser = new XmlUser();

            xmlUser.Password = this.Hash(password);
            xmlUser.UserName = username;

            if (!mXmlUsers.Contains(xmlUser))
            {
                mXmlUsers.Add(xmlUser);
            }

            using (FileStream output = File.Create(mFilename))
            {
                mSerializer.Serialize(output, mXmlUsers);
            }
        }