[ Pobierz całość w formacie PDF ]

GetClientIdleSince =
client(GetClientArrayLocByID(ClientID)).IdleSince
End Property
Public Property Get GetClientIPAddress(ClientID As Long) As String
GetClientIPAddress =
client(GetClientArrayLocByID(ClientID)).IPAddress
End Property
Public Property Get GetClientStatus(ClientID As Long) As String
GetClientStatus =
ServerGetClientStatusDescription(client(GetClientArrayLocByID(
ClientID)).Status)
End Property
Public Property Get GetClientTotalBytesDownloaded(ClientID As Long)
As Long
GetClientTotalBytesDownloaded =
client(GetClientArrayLocByID(ClientID)).TotalBytesDownloaded
End Property
Public Property Get GetClientTotalBytesUploaded(ClientID As Long)
As Long
GetClientTotalBytesUploaded =
client(GetClientArrayLocByID(ClientID)).TotalBytesUploaded
End Property
Public Property Get GetClientTotalFilesDownloaded(ClientID As Long)
As Long
GetClientTotalFilesDownloaded =
client(GetClientArrayLocByID(ClientID)).TotalFilesDownloaded
End Property
Public Property Get GetClientTotalFilesUploaded(ClientID As Long)
As Long
GetClientTotalFilesUploaded =
client(GetClientArrayLocByID(ClientID)).TotalFilesUploaded
48 D:\KISIU\PDFy\Chudy\Ksią\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01a.doc
Rozdział 1. f& 49
f& Zabezpieczanie portów i usług
f&
f&
End Property
Public Property Get GetClientUserName(ClientID As Long) As String
GetClientUserName =
client(GetClientArrayLocByID(ClientID)).UserName
End Property
Public Function StartServer() As Long
If ServerActive = True Then
StartServer = 1001
Exit Function
End If
If Port
StartServer = 1002
Exit Function
End If
If TransferBufferSize
With frmWinsock.CommandSock(0)
.LocalPort = Port
.Listen
End With
ServerActive = True
RaiseEvent ServerStarted
End Function
Public Sub NewClient(requestID As Long)
Dim tmpID As Long
Dim i As Integer
ConnectedClients = ConnectedClients + 1
ClientCounter = ClientCounter + 1
tmpID = ClientCounter
Do
i = i + 1
Loop Until client(i).inUse = False
With client(i)
.inUse = True
Load frmWinsock.CommandSock(i)
Load frmWinsock.DataSock(i)
frmWinsock.CommandSock(i).Accept requestID
.ConnectedAt = Now
.ID = tmpID
.Status = stat_LOGGING_IN
.IdleSince = Now
.IPAddress = frmWinsock.CommandSock(i).RemoteHostIP
End With
RaiseEvent NewClient(client(i).ID)
If ((ConnectedClients > MaxClients) And (MaxClients 0)) Or
(ConnectedClients > MAX_CONNECTIONS) Then
SendResponse i, "421 Too many users - try again later."
LogoutClient , i
Exit Sub
End If
SendResponse i, "220 P1mp FTP Engine version " & App.Major & ".0"
& App.Minor & " build " & App.Revision
End Sub
Private Sub SendResponse(sckArrayLoc As Integer, data As String)
frmWinsock.CommandSock(sckArrayLoc).SendData data & vbCrLf
DoEvents
End Sub
Private Sub SendData(sckArrayLoc As Integer, data As String)
frmWinsock.DataSock(sckArrayLoc).SendData data
D:\KISIU\PDFy\Chudy\Ksią\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01a.doc 49
50 Hack Wars. Tom 2. Na tropie hakerów
End Sub
Public Sub SendComplete(sckArrayLoc As Integer)
With client(sckArrayLoc)
Select Case .Status
Case stat_GETTING_DIR_LIST
frmWinsock.DataSock(sckArrayLoc).Close
SendResponse sckArrayLoc, "226 Transfer complete."
.Status = stat_IDLE
RaiseEvent ClientStatusChanged(.ID)
Case stat_DOWNLOADING
If .cFileTotalBytes = .cTotalBytesXfer Then
Close #.fFile
frmWinsock.DataSock(sckArrayLoc).Close
.DataPort = 0
SendResponse sckArrayLoc, "226 Transfer
complete."
.cFileTotalBytes = 0
.cTotalBytesXfer = 0
.Status = stat_IDLE
RaiseEvent ClientStatusChanged(.ID)
Else
SendFile sckArrayLoc
End If
End Select
End With
End Sub
Private Sub LoginClient(cArrayLoc As Integer, Password As String)
With client(cArrayLoc)
.HomeDir = "C:\TFTP"
.CurrentDir = .HomeDir
SendResponse cArrayLoc, "230 User logged in, proceed."
.Status = stat_IDLE
End With
RaiseEvent ClientLoggedIn(ByVal client(cArrayLoc).ID)
RaiseEvent ClientStatusChanged(ByVal client(cArrayLoc).ID)
End Sub
Public Sub LogoutClient(Optional ByVal ID As Long, Optional cArrayLoc
As Integer)
On Error Resume Next
If ID = 0 And cArrayLoc = 0 Then Exit Sub
Dim ArrayPos As Integer
Dim tmp As Long
If ID = 0 Then
ArrayPos = cArrayLoc
Else
ArrayPos = GetClientArrayLocByID(ID)
End If
If client(ArrayPos).ID = 0 Then Exit Sub
If ArrayPos
With client(ArrayPos)
frmWinsock.CommandSock(ArrayPos).Close
frmWinsock.DataSock(ArrayPos).Close
Unload frmWinsock.CommandSock(ArrayPos)
Unload frmWinsock.DataSock(ArrayPos)
If .fFile 0 Then Close #.fFile
.ConnectedAt = ""
.ConnectMode = 0
.cTotalBytesXfer = 0
50 D:\KISIU\PDFy\Chudy\Ksią\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01a.doc
Rozdział 1. f& 51
f& Zabezpieczanie portów i usług
f&
f&
.cFileTotalBytes = 0
.CurrentDir = ""
.CurrentFile = ""
.DataPort = 0
.fFile = 0
.HomeDir = ""
tmp = .ID
.ID = 0
.IdleSince = ""
.IPAddress = ""
.Status = stat_IDLE
.TotalBytesDownloaded = 0
.TotalBytesUploaded = 0
.TotalFilesDownloaded = 0
.TotalFilesUploaded = 0
.UserName = ""
.inUse = False
End With
If ConnectedClients > 0 Then ConnectedClients =
ConnectedClients - 1
RaiseEvent ClientLoggedOut(ByVal tmp)
End Sub [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • spiewajaco.keep.pl
  • © 2009 Nie chcę już więcej kochać, cierpieć, czekać ani wierzyć w rzeczy, których nie potwierdza życie. - Ceske - Sjezdovky .cz. Design downloaded from free website templates