Remove() публичный Метод

Removes a domain name from the hosts file
public Remove ( string Domain ) : bool
Domain string The domain name
Результат bool
Пример #1
0
        /// <summary>
        /// Removes all gamespy related redirects in the specified hosts file container
        /// </summary>
        /// <param name="HostFile"></param>
        private static void RemoveRedirects(HostsFile HostFile)
        {
            // Remove Gamespy Addresses. Use a Bitwise OR here to execute both methods
            if (HostFile.Remove(Bf2StatsHost) | HostFile.RemoveAll(GamespyHosts))
            {
                // Save Changes
                HostFile.Save();

                // Flush the Cache of the gamespy hosts
                foreach (string host in GamespyHosts)
                {
                    DnsFlushResolverCacheEntry(host);
                }

                // Flush stats server
                DnsFlushResolverCacheEntry(Bf2StatsHost);
            }
        }
Пример #2
0
        /// <summary>
        /// Removes all gamespy related redirects in the specified hosts file container
        /// </summary>
        /// <param name="HostFile"></param>
        private static void RemoveRedirects(HostsFile HostFile)
        {
            // Remove Gamespy Addresses. Use a Bitwise OR here to execute both methods
            if (HostFile.Remove(Bf2StatsHost) | HostFile.RemoveAll(GamespyHosts))
            {
                // Save Changes
                HostFile.Save();

                // Flush the Cache of the gamespy hosts
                foreach (string host in GamespyHosts)
                    DnsFlushResolverCacheEntry(host);

                // Flush stats server
                DnsFlushResolverCacheEntry(Bf2StatsHost);
            }
        }