📄 frmapplications.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmApplications
BackColor = &H00FFFFFF&
BorderStyle = 3 'Fixed Dialog
Caption = "应用程序"
ClientHeight = 5490
ClientLeft = 45
ClientTop = 435
ClientWidth = 5445
Icon = "frmApplications.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmApplications.frx":000C
ScaleHeight = 366
ScaleMode = 3 'Pixel
ScaleWidth = 363
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin OnIt_Pro_Firewall.CandyButton Command3
Height = 375
Left = 120
TabIndex = 3
Top = 5040
Width = 1095
_extentx = 1931
_extenty = 661
font = "frmApplications.frx":6AD1
caption = "更改"
captionhighlitecolor= 0
iconhighlitecolor= 0
checked = 0 'False
colorbuttonhover= 16760976
colorbuttonup = 15309136
colorbuttondown = 15309136
colorbright = 16772528
borderbrightness= 0
displayhand = 0 'False
colorscheme = 0
End
Begin OnIt_Pro_Firewall.CandyButton Command2
Height = 375
Left = 4200
TabIndex = 2
Top = 5040
Width = 1095
_extentx = 1931
_extenty = 661
font = "frmApplications.frx":6AF5
caption = "确定"
captionhighlitecolor= 0
iconhighlitecolor= 0
checked = 0 'False
colorbuttonhover= 16760976
colorbuttonup = 15309136
colorbuttondown = 15309136
colorbright = 16772528
borderbrightness= 0
displayhand = 0 'False
colorscheme = 0
End
Begin MSComctlLib.ListView lvApplications
Height = 4095
Left = 105
TabIndex = 1
Top = 840
Width = 5175
_ExtentX = 9128
_ExtentY = 7223
View = 3
LabelEdit = 1
Sorted = -1 'True
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
HoverSelection = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 4
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "程序名称"
Object.Width = 4304
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "版本"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "存取"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "路径"
Object.Width = 9596
EndProperty
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = " 设定或者修改应用程序的存取权限。你可以改变他们的属性状态或者从列表中移除。"
Height = 510
Left = 120
TabIndex = 0
Top = 240
Width = 5175
End
Begin VB.Menu mnuModify
Caption = "mnuModify"
Visible = 0 'False
Begin VB.Menu mnuModifyTrust
Caption = "Trust"
End
Begin VB.Menu mnuModifyAsk
Caption = "Ask"
End
Begin VB.Menu mnuModifyBlock
Caption = "Block"
End
Begin VB.Menu mnuModifyTerminate
Caption = "Terminate"
End
Begin VB.Menu mnuModifySep1
Caption = "-"
End
Begin VB.Menu mnuModifyDelete
Caption = "Delete"
End
Begin VB.Menu mnuModifySep2
Caption = "-"
End
Begin VB.Menu mnuModifyAdvRules
Caption = "Monitor For Changes"
End
End
End
Attribute VB_Name = "frmApplications"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居汉化收藏整理
'发布日期:2007/09/20
'描 述:界面清爽VB版高级专业防火墙 Ver 2.0.3
'网 站: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
Private Sub Command2_Click()
frmMain.ProgressBar1.Visible = False
Unload Me
End Sub
Private Sub Command3_Click()
Dim idNum As Long
Dim strTemp As String
On Error Resume Next
idNum = lvApplications.SelectedItem.Index
If idNum <> 0 Then
strTemp = lvApplications.SelectedItem.Text
If LenB(strTemp) = 0 Then
strTemp = Mid$(lvApplications.SelectedItem.SubItems(3), InStrRev(lvApplications.SelectedItem.SubItems(3), "\") + 1)
End If
mnuModifyTrust.Caption = "总是允许 (" & strTemp & ")"
mnuModifyBlock.Caption = "总是阻止 (" & strTemp & ")"
mnuModifyAsk.Caption = "询问 (" & strTemp & ")"
mnuModifyTerminate.Caption = "总是停止 (" & strTemp & ")"
mnuModifyDelete.Caption = "从列表中删除 (" & strTemp & ")."
PopupMenu mnuModify
End If
On Error GoTo 0
End Sub
Private Sub Form_Load()
Dim StrParse() As String
Dim i As Long
Dim Item As ListItem
Dim tmpFileName As String
Dim ii As Long
With frmMain
.ProgressBar1.Visible = True
.ProgressBar1.Value = 0
End With 'frmMain
cINIFile.Section = "RULES"
On Error Resume Next
StrParse = Split(cINIFile.INISection, vbNullChar)
For ii = 0 To UBound(StrParse) - 1
cINIFile.Key = StrParse(ii)
Next ii
frmMain.ProgressBar1.Max = ii
For i = 0 To UBound(StrParse) - 1
cINIFile.Key = StrParse(i)
If LenB(cINIFile.Value) Then
Set Item = lvApplications.ListItems.Add()
With Item
.Text = GetFileDescription(StrParse(i))
.SubItems(2) = GetRule(cINIFile.Value)
.SubItems(1) = GetFileVersion(StrParse(i))
.SubItems(3) = StrParse(i)
End With 'Item
End If
tmpFileName = Mid$(StrParse(i), InStrRev(StrParse(i), "\") + 1)
If LenB(Item.Text) = 0 Then
Item.Text = tmpFileName '"(No Application Name)"
End If
If LenB(tmpFileName) = 0 Then
Item.Text = "(没有程序名称)"
End If
If LenB(Item.SubItems(1)) = 0 Then
Item.SubItems(1) = "(未知)"
End If
If LenB(Item.SubItems(3)) = 0 Then
With Item
.Text = vbNullString
.SubItems(1) = vbNullString
.SubItems(2) = vbNullString
.SubItems(3) = vbNullString
End With
End If
frmMain.ProgressBar1.Value = frmMain.ProgressBar1.Value + 1
Next i
On Error GoTo 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmMain.ProgressBar1.Visible = False
End Sub
Public Function GetRule(ByVal Value As String) As String
Select Case Value
Case "0" 'ask
GetRule = "Ask"
Case "1" 'block
GetRule = "Block"
Case "2" 'trust
GetRule = "Trust"
Case "3" 'terminate
GetRule = "Terminate"
End Select
End Function
Private Sub lvApplications_MouseDown(Button As Integer, _
Shift As Integer, _
X As Single, _
Y As Single)
If Button = 2 Then ' if the mousebutton 2 is pressed (right)
Command3_Click ' then it calls the menu which is hidden to be shown
End If ' at the cordinates of the mousepointer (x,y)
End Sub
Private Sub mnuModifyAdvRules_Click()
Dim Filename As String
Dim idNum As Long
idNum = lvApplications.SelectedItem.Index
Filename = lvApplications.ListItems.Item(idNum).SubItems(3)
frmMainFileCheck.lvAddItem Filename
End Sub
Private Sub mnuModifyAsk_Click()
'Add rule to ask this
With cINIFile
.Section = "RULES"
.Key = lvApplications.SelectedItem.SubItems(3)
.Value = "0"
End With 'cINIFile
lvApplications.SelectedItem.SubItems(2) = "询问"
End Sub
Private Sub mnuModifyBlock_Click()
'Add rule to block this
With cINIFile
.Section = "RULES"
.Key = lvApplications.SelectedItem.SubItems(3)
.Value = "1"
End With 'cINIFile
lvApplications.SelectedItem.SubItems(2) = "阻止"
End Sub
Private Sub mnuModifyDelete_Click()
'delete this
With cINIFile
.Section = "RULES"
.Key = lvApplications.SelectedItem.SubItems(3)
.DeleteValue
End With 'cINIFile
lvApplications.ListItems.Remove lvApplications.SelectedItem.Index
End Sub
Private Sub mnuModifyTerminate_Click()
'Add rule to terminate this
With cINIFile
.Section = "RULES"
.Key = lvApplications.SelectedItem.SubItems(3)
.Value = "3"
End With 'cINIFile
lvApplications.SelectedItem.SubItems(2) = "终止"
End Sub
Private Sub mnuModifyTrust_Click()
'Add rule to trust this
With cINIFile
.Section = "RULES"
.Key = lvApplications.SelectedItem.SubItems(3)
.Value = "2"
End With 'cINIFile
lvApplications.SelectedItem.SubItems(2) = "信任"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -