Ideea e ca vreau cand scriu de la tastura niste orase,sa nu mi se rescriere orasul ,adica pun Bacau,apoi pun Iasi,sa fie o lista
<Tur>
<Tara>
<Oras>Bacau</Oras>
</Tara>
<Tara>
<Oras>Iasi</Oras>
</Tara>
</Tur>
Dar imi rescriere ce pun de la tastura in xml
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace ConsoleApplication9
{
class Program
{
static void Main(string[] args)
{
sergiu ab = new sergiu();
XDocument xml = new XDocument(
new XElement("tur",ab.asa())
);
xml.Save("data.xml");
Console.ReadKey();
}
public class sergiu
{
string a { get; set; }
public void asaa()
{
a = Console.ReadLine();
new XElement("Tara",
new XElement("Oras", a)
);
}
public string
asa()
{
for (int i = 0; i <= 4; i++)
{
asaa();
}
return a;
}
}
}
}