Public Shared Sub SaveSetting(ByVal strKeyName As String, ByVal strKeyValue As String, ByVal strWhich As String)
Dim XMLWebSetting As New System.Xml.XmlDocument
XMLWebSetting.Load(System.Web.HttpContext.Current.Server.MapPath(("~/" + strWhich)))
Dim XmlNodeList As System.Xml.XmlNodeList = XMLWebSetting.SelectSingleNode("//appSettings").ChildNodes
Try
Dim xn As System.Xml.XmlNode
For Each xn In XmlNodeList
Dim xe As System.Xml.XmlElement = CType(xn, System.Xml.XmlElement)
If xe.Attributes("key").InnerText = strKeyName Then
xe.Attributes("value").InnerText = strKeyValue
XMLWebSetting.Save(System.Web.HttpContext.Current.Server.MapPath(("~/" + strWhich)))
Exit For
End If
Next xn
Catch Ex As System.Exception
Throw Ex
End Try
End Sub