var fileStream = new FileStream(XMLFileName, FileMode.Open);
XmlSerializer serializer = new XmlSerializer(typeof(Members));
var _nds = (Members)serializer.Deserialize(fileStream);
if (_nds.Radiostation.Title == MainForm.nameStation)
{
editTitleRadiostation.Text = _nds.Radiostation.Name;
editCountryPanel.Text = _nds.Radiostation.Country;
editGenrePanel.Text = _nds.Radiostation.Genre;
editSubGenrePanel.Text = _nds.Radiostation.Subgenre;
editUrlPanel.Text = _nds.Radiostation.Urlwww;
editIcoPanel.Text = _nds.Radiostation.Ico;
}
fileStream.Close();
<?xml version="1.0" encoding="utf-8" ?>
<users>
<radiostation name="radiostation1">
<country>Латвия</country>
<genre>Поп</genre>
<subgenre />
<title>Сконто</title>
<urlwww>1</urlwww>
<ico />
</radiostation>
<radiostation name="radiostation2">
<country>Россия</country>
<genre>Разное</genre>
<subgenre />
<title>Монтекарло</title>
<urlwww>1</urlwww>
<ico />
</radiostation>
<radiostation name="radiostation2">
<country>Россия</country>
<genre>Релакс, Легкая музыка</genre>
<subgenre />
<title>Радио рекорд</title>
<urlwww>1</urlwww>
<ico />
</radiostation>
</users>
var fileStream = new FileStream(XMLFileName, FileMode.Open);
XmlSerializer serializer = new XmlSerializer(typeof(Members));
var _nds = (Members)serializer.Deserialize(fileStream);
editTitleRadiostation.Text = _nds.Radiostation.Name;
Ошибка вот в этой строке s = s + string.Format(str, textBox1.Lines[0], textBox1.Lines[1], textBox1.Lines[2], textBox1.Lines[3]); - System.IndexOutOfRangeException: Индекс находился вне границ массива.