السلام عليكم ورحمة الله وبركاته
من يساعدني في شرح هذه الشفرة خطوة بخطوة عسى الله ان يجزيه خير الدنيا والأخرة (أي توضيح كامل عن كل شىء فيها)
الشفرة هي
Private Sub tcpClient_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim ifreefile
DoEvents
tcpClient.GetData strData
If Right$(strData, 7) = "FILEEND" Then
bFileArriving = False
lblProgress = "Saving File to " & App.Path & "\" & sFile
sArriving = sArriving & Left$(strData, Len(strData) - 7)
ifreefile = FreeFile
If Dir(sFile) <> "" Then
MsgBox "File Already Exists"
Else
Open sFile For Binary Access Write As #ifreefile
Put #ifreefile, 1, sArriving
Close #ifreefile
ShellExecute 0, vbNullString, App.Path & "\" & sFile, vbNullString, vbNullString, vbNormalFocus
End If
lblProgress = "Complete"
ElseIf Left$(strData, 4) = "FILE" Then
bFileArriving = True
sFile = Right$(strData, Len(strData) - 4)
ElseIf bFileArriving Then
lblProgress = "Receiving " & bytesTotal & " bytes for " & sFile & " from " & tcpClient.RemoteHostIP
sArriving = sArriving & strData
End If
End Sub
