Walter.Net.HoneyPot
Item(Int32) Property
Example 
Walter.Net.HoneyPot Assembly > Walter.Net.HoneyPot Namespace > IPortScannerDetectionService Interface > Item Property : Item(Int32) Property
The index of the listener to retrieve.
Gets the IHoneyPotPortListner at the specified index.
Syntax
IHoneyPotPortListner Item( 
   int index
) {get;}

Parameters

index
The index of the listener to retrieve.

Property Value

The IHoneyPotPortListner at the specified index.
Example
using Microsoft.Extensions.DependencyInjection;
using System;
            
public class Example
{
    public static void Main()
    {
        // Configure services
        var serviceProvider = new ServiceCollection()
            .UsePortScannerProtection(option =>
            {
                option.Echo = 7;
                option.IgnoreAfterDetection = IgnoreScope.IPAddressAndPort;
            })
            .BuildServiceProvider();
            
        // Retrieve the port scanner detection service
        var portScannerService = serviceProvider.GetRequiredService<IPortScannerDetectionService>();
            
        // Access a HoneyPotPortListener by index
        IHoneyPotPortListner listener = portScannerService[0];
        listener.OnDetecting += (sender, e) =>
        {
            Console.WriteLine("Ping detected from IP: " + e.IPAddress);
        };
            
        // Start the service
        portScannerService.Start();
            
        // Additional logic here
    }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IPortScannerDetectionService Interface
IPortScannerDetectionService Members
Overload List