⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modprograms.bas

📁 入侵检测是近几年发展起来的新型网络安全策略
💻 BAS
字号:
Attribute VB_Name = "ModPrograms"
'****************************************************************************
'人人为我,我为人人
'枕善居汉化收藏整理
'发布日期:2006/12/23
'描    述:非常专业的防火墙源代码
'网    站:http://www.Mndsoft.com/  (VB6源码博客)
'网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
'e-mail  :Mndsoft@163.com
'e-mail  :Mndsoft@126.com
'OICQ    :88382850
'          如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Option Explicit
Public Type tProgram
    sName                           As String
    sLocation                       As String
    sShortLocation                  As String
    iServer                         As Integer
    iAccess                         As Integer
    iID                             As Integer
End Type
Public Sub LoadPrograms()
    Static bLoaded                  As Boolean
    Dim X                           As Integer
    Dim sCol                        As Collection
    Dim sProgram                    As tProgram
    Dim sTmp                        As String
    Dim Item                        As ListItem
    Debug.Print "Loading"
    If bLoaded = True Then Exit Sub
    bLoaded = True
    Set sCol = EnumRegistryKeys(vHKEY_LOCAL_MACHINE, "Software\EliteProdigy\Fire Gate\Programs")
    LoadProcessUserIDs
    GetProcs
    If sCol.Count > 0 Then
        ReDim g_aPrograms(sCol.Count - 1)
        For X = 1 To sCol.Count
            With sProgram
                sTmp = CStr(sCol(X))
                sTmp = "Software\EliteProdigy\Fire Gate\Programs\" & sTmp
                .sName = REGGetSetting(vHKEY_LOCAL_MACHINE, sTmp, "Name")
                .sLocation = LCase(REGGetSetting(vHKEY_LOCAL_MACHINE, sTmp, "Path"))
                .sShortLocation = LCase(REGGetSetting(vHKEY_LOCAL_MACHINE, sTmp, "Short Path"))
                .iID = X - 1
                .iAccess = iRegGetSetting(vHKEY_LOCAL_MACHINE, sTmp, "Access", 0)
                .iServer = iRegGetSetting(vHKEY_LOCAL_MACHINE, sTmp, "Server", 0)
                g_aProgramDescriptions.Add .sLocation, .sName
                FrmMain.lstPrograms.Icons = FrmMain.ilTray
                FrmMain.lstPrograms.SmallIcons = FrmMain.ilTray
                Set Item = FrmMain.lstPrograms.ListItems.Add(, , , , 13)
                Item.ListSubItems.Add , , .sName
                Select Case .iAccess
                    Case Is = 0
                        With Item.ListSubItems.Add(, , "Ask")
                            .ForeColor = vbMagenta
                            .Bold = True
                        End With
                    Case Is = 1
                        With Item.ListSubItems.Add(, , "Deny")
                            .ForeColor = vbRed
                            .Bold = True
                        End With
                    Case Is = 2
                        With Item.ListSubItems.Add(, , "Allow")
                            .ForeColor = vbGreen
                            .Bold = True
                        End With
                End Select
                Select Case .iServer
                    Case Is = 0
                        With Item.ListSubItems.Add(, , "Ask")
                            .ForeColor = vbMagenta
                            .Bold = True
                        End With
                    Case Is = 1
                        With Item.ListSubItems.Add(, , "Deny")
                            .ForeColor = vbRed
                            .Bold = True
                        End With
                    Case Is = 2
                        With Item.ListSubItems.Add(, , "Allow")
                            .ForeColor = vbGreen
                            .Bold = True
                        End With
                End Select
                Item.key = .sLocation
            End With
            g_aPrograms(X - 1) = sProgram
        Next
    End If
    Set Item = Nothing
End Sub
Public Function T_UBound(aArr() As tProgram) As Integer
    On Error GoTo ErrClear
    T_UBound = UBound(aArr)
    Exit Function
ErrClear:
    Err.Clear
    T_UBound = -1
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -