Exemplo n.º 1
0
        public static string GetLoginAttribute(string file, LoginType Type, LogicInformation attribute)
        {
            XElement root = XElement.Load(file);

            XElement elem = root
                            .Elements(LoginType.Accout.ToString())
                            .Single(itemName => itemName.Attribute(LoginType.LogicType.ToString()).Value == Type.ToString());

            return(elem.Attribute(attribute.ToString()).Value);
        }
Exemplo n.º 2
0
        public static void SetLoginAttribute(string file, LoginType Type, LogicInformation attribute, string newValue)
        {
            XElement root = XElement.Load(file);

            XElement elem = root
                            .Elements(LoginType.Accout.ToString())
                            .Single(itemName => itemName.Attribute(LoginType.LogicType.ToString()).Value == Type.ToString());

            elem.Attribute(attribute.ToString()).Value = newValue;

            root.Save(file);
        }