src/packages/EmbedIO/Security/IPBanningModule.cs
/// <summary>
/// Tries to ban an IP explicitly.
/// </summary>
/// <param name="address">The IP address to ban.</param>
/// <param name="banUntil">A <see cref="DateTime" /> specifying the expiration time of the ban.</param>
/// <param name="baseRoute">The base route.</param>
/// <param name="isExplicit"><c>true</c> if the IP was explicitly banned.</param>
/// <returns>
///   <c>true</c> if the IP was added to the blacklist; otherwise, <c>false</c>.
/// </returns>
/// <exception cref="ArgumentException">baseRoute</exception>
Tries to ban an IP explicitly.
Tries to ban an IP explicitly .
public static bool TryBanIP(IPAddress address, DateTime banUntil, string baseRoute = "/", bool isExplicit = true)
        {
            if (!IPBanningExecutor.TryGetInstance(baseRoute, out var instance))
                throw new ArgumentException(NoConfigurationFound, nameof(baseRoute));
            return instance.TryBanIP(address, isExplicit, banUntil);
        }
public static bool TryBanIP ( IPAddress address , DateTime banUntil , string baseRoute = " " , bool isExplicit = true ) { if ( ! IPBanningExecutor . TryGetInstance ( baseRoute , out var instance ) ) throw new ArgumentException ( NoConfigurationFound , nameof ( baseRoute ) ) ; return instance . TryBanIP ( address , isExplicit , banUntil ) ; }
Tries to ban an IP explicitly.
Tries to ban an IP explicitly .
None
None
address
IPAddress
The IP address to ban.
The IP address to ban .
banUntil
DateTime
A  specifying the expiration time of the ban.
A specifying the expiration time of the ban .
baseRoute
string
The base route.
The base route .
isExplicit
bool
None