I am new to network programming. I want to create a network blocker. which blocks an IP from the LAN. How is this possible in C#?
+1
A:
In WCF I know this code works
/// <summary>
/// Returns the client IP
/// </summary>
public static string ClientIP
{
get
{
// determine IP address takes < 1ms
OperationContext context = OperationContext.Current;
MessageProperties messageProperties = context.IncomingMessageProperties;
RemoteEndpointMessageProperty endpointProperty =
messageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
return endpointProperty.Address;
}
}
kenny
2009-10-01 15:00:26
This should be helpful when Tarun figures out how to break down the problem.
Karl the Pagan
2009-10-01 15:08:57
A:
You would be mimicking what a firewall does, which is insert itself into the tcp stack to monitor all inbound traffic. Installing a firewall is definately the easiest way, otherwise start looking into using a Layered Service Provider
PaulG
2009-10-01 15:01:52