Results 1 to 4 of 4

Thread: [02/03] firewall and webservices/internet access

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    [02/03] firewall and webservices/internet access

    I have a customer who I wrote a piece of software for. The software is a windows app, but downloads information needed to run via a webservice I host on my webserver.

    Everything works great, except sometimes they go to install the software on one of their customers PCs, and the software can't hit the web because of a firewall.

    I know most half decent firewall programs will generally prompt the user for access to the web when the program tries, but apparently they have run into some situations where they can't find what software is blocking the app (and these guys are NOT computer guys. I am sure if I was there I could find the offending firewall app, and allow the access, but these installs are done all over the country, and it was only my job to write the app for them)

    So anyway, I am wondering if there is anything I can do to try to avoid this scenario.

    Is there anyway to probe what apps are blocking connections? or anything you guys can suggest to make this a little more user friendly?

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [02/03] firewall and webservices/internet access

    You might be able to use the WMI to detect if the firewall software is running (though I don't know if this detects all firewalls, and it may only work on XP+):

    VB6 Code:
    VB Code:
    1. Private Sub DumpFirewallInfo()
    2.  
    3. Dim oLocator    As WbemScripting.SWbemLocator
    4. Dim oService    As WbemScripting.SWbemServicesEx
    5. Dim oFirewalls  As WbemScripting.SWbemObjectSet
    6. Dim oFirewall   As WbemScripting.SWbemObjectEx
    7. Dim oFwMgr      As Variant
    8.    
    9.    
    10.     Set oFwMgr = CreateObject("HNetCfg.FwMgr")
    11.    
    12.     Debug.Print "Checking the Windows Firewall..."
    13.     Debug.Print "Windows Firewal Enabled: " & oFwMgr.LocalPolicy.CurrentProfile.FirewallEnabled
    14.     Debug.Print ""
    15.    
    16.     Set oFwMgr = Nothing
    17.    
    18.    
    19.     Debug.Print "Checking for other installed firewalls..."
    20.    
    21.     Set oLocator = New WbemScripting.SWbemLocator
    22.     Set oService = oLocator.ConnectServer(".", "root\SecurityCenter")
    23.     oService.Security_.ImpersonationLevel = 3
    24.  
    25.     Set oFirewalls = oService.ExecQuery("SELECT * FROM FirewallProduct") ' This could also be "AntivirusProduct"
    26.    
    27.     For Each oFirewall In oFirewalls
    28.         Debug.Print "Company:       " & vbTab & oFirewall.CompanyName
    29.         Debug.Print "Firewall Name: " & vbTab & oFirewall.DisplayName
    30.         Debug.Print "Enabled:       " & vbTab & Format$(oFirewall.Enabled)
    31.         Debug.Print "Version:       " & vbTab & oFirewall.versionNumber
    32.         Debug.Print ""
    33.     Next oFirewall
    34.    
    35.     Set oFirewall = Nothing
    36.     Set oFirewalls = Nothing
    37.     Set oService = Nothing
    38.     Set oLocator = Nothing
    39.  
    40. End Sub
    41.  
    42. Private Sub Command1_Click()
    43. DumpFirewallInfo
    44. End Sub

    Credit where credit is due: http://www.experts-exchange.com/Prog..._21645145.html

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [02/03] firewall and webservices/internet access

    Thanks. Looks like it will be useful. Its VB6 code, but I can get it to work no problem setting a COM reference in .NET.

    I am going to see if I can do it with WMI from the framework instead. I will use this as a guide.

  4. #4
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [02/03] firewall and webservices/internet access

    Yeah, converting that to framework WMI should not be hard at all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width