I would like to programmatically block or allow access to my computer based on IP address or computer name.
I tried sessions and if there was a session that I didnt like, I would close it. There were problems all over the place with that solution, mostly that it didnt work real well since Explorer will recreate the session if the one it was using got closed.
Right now, Im looking at the Firewall API. The new Vista Firewall API has all sorts of things that I could use, but Im running 2003.
I see the Scope property on the INETFwOpenPort, but I dont see any way to set the port to be ALL ports. I dont want to just block File and Print Sharing but everything but ICMP.
Does anyone know how to use the Firewall API to block ALL access from a certain address or have any other ideas how to block access from a certain IP?
Thanks
Start Free Trial