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; }
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); }