Click here to Skip to main content
15,888,160 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hye Everyone,

I need to know, if these things can be done and (if yes) how they can be done through C# code :

1. to detect if any firewall is running on System.
2. to detect if any particular port (let say 9001) is blocked (outbound/inbound)
and if yes; how to know if its outgoing blocked or incoming blocked.
3. to detect if my IP Address is blocked by ISP or not.


Please, do reply..
its urgent.

FYI : (My application is on .NET Framework 4.0 (VS 2010))

thanks in advance..
Posted
Updated 23-Mar-12 3:52am
v2

1 solution

 
Share this answer
 
v4
Comments
DeepsMann 26-Mar-12 3:43am    
Thanks..
Can u please tell me how to use

INetFwMgr.IsPortAllowed
Shahin Khorshidnia 26-Mar-12 9:23am    
INetFWMgr is an interface and you can use Activator.
for example:
INetFwMgr mgr = (INetFwMgr)Activator.CreateInstance(NetFwMgrType);

For more detail look at the updated answer.
DeepsMann 26-Mar-12 6:18am    
Can i configure ip address of my system from my application???
Shahin Khorshidnia 26-Mar-12 9:25am    
Yes. and look at the updated solution for "How"
Shahin Khorshidnia 26-Mar-12 9:26am    
And also, if the solution and links help, You can accept the solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900