Is it possible to check the status of the windows-firewall? (aktiv or
inaktive)
The following seems to do it - only limited testing though.
Private Function FireWallIsEnabled()
' return true if windows firewall is enabled
' requires option strict off (late binding)
Dim enabled As Boolean
Try
Dim fwMgr As Object = CreateObject("HNetCfg.FwMgr")
Dim profile As Object = fwMgr.LocalPolicy.CurrentProfile
Dim fwe As Integer = profile.FirewallEnabled
enabled = (fwe <> 0)
Catch ex As Exception
enabled = False ' indicate disabled if any error
End Try
Return enabled
End Function
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.