Example #1
0
        public void Set(string ip, string host)
        {
            var line = FindEntry(host);

            if (line != null)
            {
                if (line.IP != ip)
                {
                    line.Update(ip, host);
                    IsDirty = true;
                }
            }
            else
            {
                line = new HostsFileLine(ip, host);
                Lines.Add(line);
                IsDirty = true;
            }
        }
Example #2
0
        public void Set(string ip, string host)
        {
            var line = FindEntry(host);

            if (line != null)
            {
                if (line.IP != ip)
                {
                    line.Update(ip, host);
                    IsDirty = true;
                }
            }
            else
            {
                line = new HostsFileLine(ip, host);
                Lines.Add(line);
                IsDirty = true;
            }
        }