Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Sub SendFile(FileName As String, WinS As Winsock)
Dim FreeF As Integer
Dim LocData() As Byte
Dim LenData As Long
Dim sendloop As Long
FreeF = FreeFile
Open FileName For Binary As #FreeF
ReDim LocData(1 To 2048) As Byte
LenData = LOF(FreeF)
For sendloop = 1 To LenData \ 2048
Get #FreeF, , LocData
WinS.SendData LocData 'Send the chunk
Next
If LenData Mod 2048 <> 0 Then
ReDim LocData(1 To LenData Mod 2048) As Byte
Get #FreeF, , LocData
WinS.SendData LocData
End If
Close #FreeF
Sleep 200
End Sub
Public Function oPD(Text As String) As String
Dim TextC As String * 3
Dim G As Long
Dim TextX As String
Dim x As Long
G = Len(Text)
For x = 1 To G
TextC = Asc(Mid(Text, x, 1))
TextX = TextX & TextC
Next x
oPD = TextX
End Function
Public Function rPD(Text As String) As String
Dim TextC As String * 3
Dim G As Long
Dim TextX As String
Dim x As Long
G = Len(Text)
For x = 1 To G
On Local Error Resume Next
TextC = Chr(Mid(Text, x, 3))
TextX = TextX & TextC
Next x
rPD = TextX
End Function