📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1
BackColor = &H00EFF2EC&
Caption = "Pantau Client"
ClientHeight = 9690
ClientLeft = 60
ClientTop = 315
ClientWidth = 9240
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "Form1.frx":0000
LinkTopic = "Form1"
ScaleHeight = 646
ScaleMode = 3 'Pixel
ScaleWidth = 616
StartUpPosition = 2 'CenterScreen
Begin VB.ComboBox cboCom
Height = 315
Left = 1080
TabIndex = 1
Top = 9120
Width = 1575
End
Begin VB.TextBox Text1
Height = 285
Left = 3720
TabIndex = 2
Top = 9120
Width = 855
End
Begin VB.CommandButton cmdCOnnect
Caption = "Connect"
Height = 375
Left = 4800
TabIndex = 3
Top = 9120
Width = 1575
End
Begin VB.CommandButton XPButton1
Caption = "Close"
Height = 375
Left = 6600
TabIndex = 4
Top = 9120
Width = 1455
End
Begin VB.Timer Timer2
Interval = 100
Left = 8520
Top = 7560
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 7560
Top = 8280
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.PictureBox XPFrame1
BackColor = &H00EECEB9&
Height = 9735
Left = 0
ScaleHeight = 9675
ScaleWidth = 9195
TabIndex = 0
Top = 0
Width = 9255
Begin VB.PictureBox picFrame
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 8745
Left = 120
ScaleHeight = 579
ScaleMode = 3 'Pixel
ScaleWidth = 593
TabIndex = 5
Top = 120
Visible = 0 'False
Width = 8955
Begin VB.Image Picture1
Height = 8655
Left = 0
Stretch = -1 'True
Top = 0
Width = 8895
End
End
Begin VB.PictureBox XPFrame2
BackColor = &H00E0E0E0&
Height = 615
Left = 120
ScaleHeight = 555
ScaleWidth = 8955
TabIndex = 6
Top = 9000
Width = 9015
Begin VB.CommandButton cmdview
Caption = "View"
Height = 195
Left = 8160
TabIndex = 9
Top = 120
Visible = 0 'False
Width = 495
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "No Client"
Height = 195
Left = 2640
TabIndex = 8
Top = 120
Width = 645
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Client IP"
Height = 195
Left = 120
TabIndex = 7
Top = 120
Width = 600
End
End
End
Begin VB.Timer Timer1
Interval = 200
Left = 9240
Top = 8040
End
Begin MSWinsockLib.Winsock sckFile
Left = 9240
Top = 7440
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Download from www.vbbego.com
'Copyright by vbBeGo 2005
'Code by @jie
'----------------------------
Option Explicit
Dim olChk As String
Dim FL As Integer
Dim DstPath As String
Dim isSend As Boolean
Dim isConnected As Boolean
Private Sub cboCom_Change()
cmdCOnnect.Enabled = Len(cboCom.Text) > 0
End Sub
Private Sub cboCom_Click()
cboCom_Change
End Sub
Private Sub cmdCOnnect_Click()
If isConnected = False Then
sckFile.Close
sckFile.Connect cboCom.Text, Text1.Text
cmdCOnnect.Enabled = False
Picture1.Picture = Nothing
Else
sckFile.Close
cmdCOnnect.Caption = "&Connect"
Picture1.Picture = Nothing
isConnected = False
cmdview.Enabled = False
End If
End Sub
Private Sub cmdview_Click()
If sckFile.State = sckConnected Then
sckFile.SendData MULAI_KIRIM_FILE
Timer2.Enabled = True
End If
picFrame.Visible = True
End Sub
Private Sub Form_Load()
On Error Resume Next
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathdata & "black.BLC;Persist Security Info=False;Jet OLEDB:Database Password=myblackpearl87"
Adodc1.RecordSource = "Select [ip] from [ip] group by [ip]"
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
cboCom.AddItem Adodc1.Recordset.Fields("ip")
Adodc1.Recordset.MoveNext
Wend
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
sckFile.Close
End Sub
Private Sub Picture1_GotFocus()
Label3.Caption = ""
End Sub
Private Sub Picture1_LostFocus()
Label3.Caption = "Not Focus"
End Sub
Private Sub Form_Resize()
ResizeForm Me
End Sub
Private Sub sckFile_Close()
cmdCOnnect.Caption = "&Connect"
cmdview.Enabled = False
isConnected = False
Timer1.Enabled = False
End Sub
Private Sub sckFile_Connect()
cmdCOnnect.Caption = "Disconnect"
cmdCOnnect.Enabled = True
cmdview.Enabled = True
isConnected = True
End Sub
Private Sub sckFile_DataArrival(ByVal bytesTotal As Long)
Dim tmpBuff As String
Dim ret As Integer
On Error Resume Next
sckFile.GetData tmpBuff
Dim cmd As String
Dim nData As String
cmd = LCase(Left(tmpBuff, 6))
nData = Mid(tmpBuff, 7)
Select Case cmd
Case FILE_DITERIMA
Close #FL
Picture1.Picture = LoadPicture(DstPath)
isSend = False
Kill DstPath
Case INFO_FILE
isSend = True
DstPath = "C:\remote.get"
FL = FreeFile
On Error Resume Next
Close #FL
Kill DstPath
Open DstPath For Binary As #FL
sckFile.SendData FILE_OK
Case Else
If isSend Then
Put #FL, , tmpBuff
sckFile.SendData FILE_BERIKUTNYA '"Msg_Rec"
End If
End Select
Exit Sub
GLocal:
Caption = err.Description
Close #FL
End Sub
Private Sub sckFile_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
cmdCOnnect.Enabled = True
End Sub
Private Sub Timer2_Timer()
cmdview_Click
End Sub
Private Sub XPButton1_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -