TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Shockwave-p
NA
2
0
adding xmlnodes to a xml-file
Mar 14 2005 12:53 PM
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
Reply
Answers (
3
)
Hide TabControl Page
How to know when the window of my application is closed?