weis einer was hier falsch ist?
Fehler:
Code:
Es sind mehrere Stammelemente vorhanden. Zeile 3, Position 3.
Code:
<?xml version="1.0" standalone="yes" ?> <Mob vnum="101" name="'??'" />
Code:
PHP Code:
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}//Form1()
private void button1_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load("dump.xml");
XmlElement root = doc.DocumentElement;
foreach (XmlNode @Mob in root.ChildNodes)
{
textBox1.Text = (@Mob.Attributes["vnum"].InnerText);
//MessageBox.Show(@Mob.Attributes["vnum"].InnerText);
}
}//private void button1_Click(object sender, EventArgs e)
}//public partial class Form1 : Form
}//namespace WindowsFormsApplication1