Windows Firewall

L

Luke Davis

Is there a programmatic way of opening ports in Windows XP/Vista or at
worst turning on/off the windows firewall? Which libraries should I be
looking in for the firewall class?

Thanks,

Luke
 
W

Willy Denoyette [MVP]

Luke Davis said:
Is there a programmatic way of opening ports in Windows XP/Vista or at
worst turning on/off the windows firewall? Which libraries should I be
looking in for the firewall class?

Thanks,

Luke



The easiest is to run the command line utility "netsh.exe" using
Process.Start.
With "netsh firewall" you can configure the firewall configuration just like
you would with the UI tool.

Willy.
 
A

Arne Vajhøj

Peter said:
Easy way:
execute
NET STOP "Windows Firewall" using the Process class.

Assuming it is relevant to check status etc. I would
guess that using ServiceController would be easier in the
end.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top