As Ken mentioned, it's right here: <a href="http://www.windowsforms.net/Forums/ShowPost.aspx tabIndex=1&tabId=41&PostID=828">INI files</a>
It's really easy to make your own using an XPath query if you still want to after reading that thread.
Actually, I realized I can't find my code that I've used for this! :( If the following code doesn't work it should at least be close. I think my XPath query might be a little funky.
Public Sub UpdateAppSettings(ByVal Key As String, ByVal Value As String)
Dim Config As New System.Xml.XmlDocument()
Config.Load("App.config")
'make any changes here 'this one just changes one item Config.SelectSingleNode("/configuration/appSettings/add[attribute::" & Key & "]").Attributes.GetNamedItem("value").Value = Value
End Sub
If you're worried about performance, like if you need to use it for ASP.NET or something, you could probably write a more efficient one, but for WindowsForms where you only have one person executing the code at a time, this should work just fine.
Editing a config file on the fly
Rockbooster
It's really easy to make your own using an XPath query if you still want to after reading that thread.
Actually, I realized I can't find my code that I've used for this! :( If the following code doesn't work it should at least be close. I think my XPath query might be a little funky.
Public Sub UpdateAppSettings(ByVal Key As String, ByVal Value As String)
Dim Config As New System.Xml.XmlDocument()
Config.Load("App.config")
'make any changes here
'this one just changes one item
Config.SelectSingleNode("/configuration/appSettings/add[attribute::" & Key & "]").Attributes.GetNamedItem("value").Value = Value
End Sub
If you're worried about performance, like if you need to use it for ASP.NET or something, you could probably write a more efficient one, but for WindowsForms where you only have one person executing the code at a time, this should work just fine.
John_123456789
Tech_Prince