Reputation: 23
Okay so I have some code which is supposed to change a value in a configuration file.
string xmlFile = "KeePass.config.xml";
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlWriterSettings settings = new XmlWriterSettings();
settings.IndentChars = "\t";
settings.Indent = true;
xmlDoc.Load(xmlFile);
xmlDoc.SelectSingleNode("Configuration/Application/LastUsedFile").InnerText = fileName;
xmlDoc.Save(xmlFile);
The problem with this is that it indents the XML file with spaces instead of tabs and the program which reads the configuration file needs to see the XML with tab indents. Any help would be appreciated.
Upvotes: 2
Views: 2878