Exemplo n.º 1
0
 public static Model.User GetUser()
 {
     Model.User user = new Model.User();
     XmlTextReader reader = new XmlTextReader(@"user.xml");
     while (reader.Read())
     {
         if (reader.LocalName.Equals("username"))
         {
              user.UserName=reader.ReadString();
         }
         if (reader.LocalName.Equals("passwd"))
         {
             user.Password = reader.ReadString();
         }
     }
     reader.Close();
     return user;
 }
Exemplo n.º 2
0
        public static Model.User GetUser()
        {
            Model.User    user   = new Model.User();
            XmlTextReader reader = new XmlTextReader(@"user.xml");

            while (reader.Read())
            {
                if (reader.LocalName.Equals("username"))
                {
                    user.UserName = reader.ReadString();
                }
                if (reader.LocalName.Equals("passwd"))
                {
                    user.Password = reader.ReadString();
                }
            }
            reader.Close();
            return(user);
        }