Добрый вечер. По 1-у - да ошибка.
Переделал все как вы описали:
[Serializable]
[XmlRoot(ElementName = "radiostation")]
public class Radiostation
{
[XmlElement(ElementName = "country")]
public string Country { get; set; }
[XmlElement(ElementName = "genre")]
public string Genre { get; set; }
[XmlElement(ElementName = "subgenre")]
public string Subgenre { get; set; }
[XmlElement(ElementName = "title")]
public string Title { get; set; }
[XmlElement(ElementName = "urlwww")]
public string Urlwww { get; set; }
[XmlElement(ElementName = "ico")]
public string Ico { get; set; }
[XmlAttribute(AttributeName = "name")]
public string Name { get; set; }
}
[Serializable]
[XmlRoot(ElementName = "users")]
public class Members
{
[XmlElement(ElementName = "radiostation")]
public Radiostation Radiostation { get; set; }
}
пытаюсь считать так:
var fileStream = new FileStream(XMLFileName, FileMode.Open);
XmlSerializer serializer = new XmlSerializer(typeof(Radiostation));
var _nds = (Radiostation)serializer.Deserialize(fileStream);
editTitleRadiostation.Text = _nds.Name;
editCountryPanel.Text = _nds.Country;
editGenrePanel.Text = _nds.Genre;
editSubGenrePanel.Text = _nds.Subgenre;
editUrlPanel.Text = _nds.Urlwww;
editIcoPanel.Text = _nds.Ico;
Получаю ошибку : в документе XML(2,2) присутствует ошибка. Ругается на