× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

How can I delete xml file with Xml writer?

Michael Perrenoud
Feb 06, 2015
<p>If you want to delete the file, just do this:</p> <pre><code>File.Delete(path); </code></pre> <p>If you want to clear its contents:</p> <pre><code>File.WriteAllText(path, ""); </code></pre> <p>If you're doing a lot of I/O, get familiar with the static <a href="http://msdn.microsoft.com/en-us/library/system.io.file.aspx"><code>File</code></a> methods.</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/23640510/How%20can%20I%20delete%20xml%20file%20with%20Xml%20writer?/23640546">Stack Overflow</a>.</p>

Get New Tutorials Delivered to Your Inbox

New tutorials will be sent to your Inbox once a week.

comments powered by Disqus