Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public void BindToIP(BindedIpMap bindIPMap)
 {
     ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.BindToIP);
     command.Parameters.AddParameter(bindIPMap);
     
     ExecuteCommandOnCacehServer(command);
 }