Click here to Skip to main content
15,900,364 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
where can i get the C# code of these ?
http://msdn.microsoft.com/en-us/library/aa366418%28VS.85%29.aspx[^]
All are C++ or VB codes...
Posted

1 solution

using NetFwTypeLib; Use this library.

Windows Firewall[^] might help you.
 
Share this answer
 
Comments
sinoop_joy 2-Mar-11 2:50am    
How can i turn off the windows firewall using my application ?

I used this code..
<pre>
Type NetFwMgrType = Type.GetTypeFromProgID("HNetCfg.FwMgr", false);
INetFwMgr mgr = (INetFwMgr)Activator.CreateInstance(NetFwMgrType);
mgr.LocalPolicy.CurrentProfile.FirewallEnabled = false;
</pre>
But it is not working..
It gave the following errors..

http://img813.imageshack.us/i/11002172.png/
http://img535.imageshack.us/i/capturewc.jpg/
Manfred Rudolf Bihy 2-Mar-11 3:11am    
Not implemented means that the method of property is present probably because of some interface requirement. The developer choose to throw a "Not implemented" exception to make the user of the library aware that this method or property does not have the anticipated effect.
sinoop_joy 2-Mar-11 3:28am    
So i can't turn off windows firewall using my application ?
Manfred Rudolf Bihy 2-Mar-11 5:16am    
At least not with the library you are using.
sinoop_joy 2-Mar-11 7:46am    
http://msdn.microsoft.com/en-us/library/dd339606%28v=VS.85%29.aspx

says it is possible..
Bt it is in C++..
Can any one help me ?

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