Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
adding xmlnodes to a xml-file
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Shockwave-p
19y
2k
1
Reply
I have some problems adding a node to a xml-file the current xml-file:
nl
PC_STAGE2
j6FlMJT/yLc=
NewbUgfLgZU=
PC_STAGE2
winkin
name
loc
I want something like this: The elements have to be added to
by using the function AddRecentlyUsed("winking","nowhere" and AddRecentlyUsed("another","here")
nl
PC_STAGE2
j6FlMJT/yLc=
NewbUgfLgZU=
PC_STAGE2
winkin
name
loc
nowhere
here
my current code for the function AddRecentlyUsed: public static void AddRecentlyUsed(string name, string location) { string xadres = "//WinkinSettings/Recently_Used/"; XmlDocument doc = GetLocalSettings(); XmlNode node = doc.CreateNode(XmlNodeType.Element,name,xadres); XmlNode twee = doc.CreateNode(XmlNodeType.Element,location,xadres+name); twee.InnerText=location; node.AppendChild(twee); doc.AppendChild(node); doc.Save(GetLocalSettingsLocation()); MessageBox.Show("added"); } I only get an error with this, saying there is already a document element. It's probably something very dumb and simple, but I don't find get. The mistake is most likely in the doc.CreateNode
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Hide TabControl Page
How to know when the window of my application is closed?