Bizarre Assistance-VBForums
Results 1 to 3 of 3

Thread: Bizarre Assistance

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    15

    Bizarre Assistance

    Ok, to explain what I am doing, I need to create a small program that runs in the taskbar to monitor browser urls for particular words. We are using it at work to catch people going to certain banned websites in the work place.

    Right now it works if i hand code each banned site into the code directly and run with a timer:

    Code:
    For Each window As InternetExplorerMedium In New ShellWindows()
                Dim address As String = window.LocationURL.ToString
                If address.Contains("www.facebook") _
                 orelse if address.Contains("www.myspace") then
    
                 'inserted email event
             
              End If
            Next
    This works perfectly. Problem now is the Admins want direct access to add/remove different sites to the list. There is no way I am giving them access directly to my code (a bad day comes to mind). So I am attaching a small database with a small table to the server and allowing them to add URLS there. I am stuck in how to use this data though.

    I have tried pulling up the database column into a listbox but can not configure the code to check each line in listbox to compare to each browser window.

    I also tried listed the items in a one column datagrid and try to loop through each row to compare each window.

    Both events got really ugly. My question is what is the best approach for this? I need each browser window to be compared to a list of items and trigger events if a match is found.

    p.s. If your wondering why I am building this, our IS security people are all or nothing. Either no Net or Full Access. Also our people are a bit to smart to be tracked through history or simple blocking methods.

  2. #2
    Frenzied Member Campion's Avatar
    Join Date
    Jul 2007
    Location
    UT
    Posts
    1,098

    Re: Bizarre Assistance

    Not that what your are doing is a bad idea, but ideally, it would be better if you had a firewall to keep track of who goes where, and block certain sites. This is how it's done with my company's VPN.
    From my burrow, 2 feet under.

  3. #3
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    Re: Bizarre Assistance

    There are too many options to do this, so it is best to get a straight answer unstead of discussing everything till the second coming.

    If changes to the list will not be considered untill the next start of the program you may want to aggregate the urls into a single string and use address.Contains as you are doing now. Otherwise here is how to loop through a listbox.
    Code:
            For Each obj As Object In ListBox1.Items
    
                If address.Contains(obj.ToString) Then
    
                    'inserted email event
    
                End If
            Next
    VB 2005, Win Xp Pro sp2

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.