Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
frmMenu.frm
Package: FireWall.rar [view]
Upload User: yinyu8822
Upload Date: 2021-04-28
Package Size: 79k
Code Size: 3k
Category:
Firewall-Security
Development Platform:
Visual Basic
- VERSION 5.00
- Begin VB.Form frmMenu
- Caption = "防火墙"
- ClientHeight = 345
- ClientLeft = 165
- ClientTop = 735
- ClientWidth = 4680
- LinkTopic = "Form1"
- ScaleHeight = 345
- ScaleWidth = 4680
- StartUpPosition = 3 '窗口缺省
- Begin VB.Menu mnuMain
- Caption = "mnuMain"
- Begin VB.Menu mnuOpen
- Caption = "打开(&O)"
- End
- Begin VB.Menu mnuSep
- Caption = "-"
- End
- Begin VB.Menu mnuExit
- Caption = "退出(&x)"
- End
- End
- Begin VB.Menu mnuConn
- Caption = "mnuConn"
- Begin VB.Menu mnuDis
- Caption = "断开连接(非阻止)"
- End
- Begin VB.Menu mnuSep2
- Caption = "-"
- End
- Begin VB.Menu mnuBlockAll
- Caption = "阻止所有"
- End
- Begin VB.Menu mnuBlockIP
- Caption = "阻止IP"
- End
- Begin VB.Menu mnuBlockRP
- Caption = "阻止远程端口"
- End
- Begin VB.Menu mnuBlockLP
- Caption = "阻止本地端口"
- End
- End
- End
- Attribute VB_Name = "frmMenu"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- 'Download by http://www.codefans.net
- Private Sub mnuBlockAll_Click()
- BlockList True, True, True
- End Sub
- Private Sub mnuBlockIP_Click()
- BlockList True, False, False
- End Sub
- Private Sub mnuBlockLP_Click()
- BlockList False, False, True
- End Sub
- Private Sub mnuBlockRP_Click()
- BlockList False, True, False
- End Sub
- Private Sub mnuDis_Click()
- Dim tcpt As MIB_TCPTABLE
- Dim l As Long
- Dim i As Long
- Dim RemA As String, RemP As String, LocP As String
- i = Right(frmMain.ListView1.SelectedItem.key, Len(frmMain.ListView1.SelectedItem.key) - 1) + 1
- RemA = frmMain.ListView1.ListItems(i)
- RemP = frmMain.ListView1.ListItems(i).SubItems(1)
- LocP = frmMain.ListView1.ListItems(i).SubItems(2)
- l = Len(MIB_TCPTABLE)
- GetTcpTable tcpt, l, 0
- tcpt.table(i - 1).dwState = 12
- SetTcpEntry tcpt.table(i - 1)
- DoEvents
- Log RemA, RemP, LocP, "disconnected connection (no block)"
- End Sub
- Private Sub mnuExit_Click()
- frmWarnExit.Show
- End Sub
- Private Sub mnuOpen_Click()
- If frmMain.WindowState = 0 Then
- frmMain.Show
- frmMain.WindowState = 0
- Else
- frmMain.Show
- SetFGWindow frmMain.hwnd, True
- End If
- End Sub
- Public Function BlockList(ra As Boolean, rp As Boolean, lp As Boolean)
- Dim i As Long
- Dim RemA As String, RemP As String, LocP As String
- i = Right(frmMain.ListView1.SelectedItem.key, Len(frmMain.ListView1.SelectedItem.key) - 1) + 1
- RemA = frmMain.ListView1.ListItems(i)
- RemP = frmMain.ListView1.ListItems(i).SubItems(1)
- LocP = frmMain.ListView1.ListItems(i).SubItems(2)
- If ra Then modReg.bSetRegValue HKEY_LOCAL_MACHINE, SREG & "blockip", RemA, "1"
- If rp Then modReg.bSetRegValue HKEY_LOCAL_MACHINE, SREG & "blockrp", RemP, "1"
- If lp Then modReg.bSetRegValue HKEY_LOCAL_MACHINE, SREG & "blocklp", LocP, "1"
- frmMain.RefreshTable True
- Log RemA, RemP, LocP, "blocked all"
- End Function