public void BindToIP(BindedIpMap bindIPMap) { Hashtable bindTable = bindIPMap.Map; string path = ServiceFilePath; if (File.Exists(path)) { XmlDocument document = new XmlDocument(); document.Load(path); string xPath = "/configuration/appSettings/add"; string[] elementKeys = { "NCacheServer.BindToIP" }; string[] elementValues = { bindTable.ContainsKey(Channel.Cluster) ? (string)bindTable[Channel.Cluster] : "", bindTable.ContainsKey(Channel.SocketServer) ? (string)bindTable[Channel.SocketServer] : "" }; for (int i = 0; i < elementKeys.Length; i++) { this.ChangeAttribute(document, xPath, elementKeys[i], elementValues[i]); } document.Save(path); } }
public void BindToIP(BindedIpMap bindIPMap) { ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.BindToIP); command.Parameters.AddParameter(bindIPMap); ExecuteCommandOnCacehServer(command); }