Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi everyone.

 

I am wondering how to write to an xml file.

This is the xml file that i made in notepad and i want it to write to it:

 

<blacklist>

<name>mspaint</name

<name>notepad</name>

</blacklist>

 

i want it to add another 'name' node and put text in it.

 

:confused: :confused: :confused: :confused: :confused:

  • Administrators
Posted

There are several ways you could do this, XmlWriter is a fairly low level mechanism but might be suitable if you are maintaining a simple structure.

 

An alternative route could be using the DOM via XmlDocument class.

 

Personally I would tend towards using XmlSerialization as it gives a cleaner code model in my opinion.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...