Last active
December 28, 2015 06:19
-
-
Save software-mariodiana/7456325 to your computer and use it in GitHub Desktop.
Turn off POS logging in RetailStore.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports System.Xml | |
Sub TurnOffPOSLoggingInFile(posConfigFilePath As String) | |
Dim doc As New XmlDocument() | |
doc.Load(posConfigFilePath) | |
' We want the "Add" nodes, which are the only child nodes at the end of this path | |
Dim posConfigurationNodes As XmlNodeList = doc.Item("configuration").Item("system.diagnostics").Item("switches").ChildNodes | |
' Explicitly restricting this to these 3 makes it even safer | |
Dim targets As New ArrayList() | |
targets.Add("TraceEnableSwitch") | |
targets.Add("TrickleTraceEnableSwitch") | |
targets.Add("TraceLevelSwitch") | |
Dim settingName As String | |
For Each posAddNode As XmlNode In posConfigurationNodes | |
settingName = posAddNode.Attributes("name").Value | |
If targets.Contains(settingName) Then | |
posAddNode.Attributes("value").Value = "0" | |
End If | |
Next | |
doc.Save(posConfigFilePath) | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment