示例#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;
            }
        }
示例#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;
            }
        }