LATO SERVER******************************************** *****
Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim sBuffer As Byte
Winsock2.GetData strData
If strData = "START_GRAB" Then
Call keybd_event(&H2C, 1, 0, 0)
SavePicture Clipboard.GetData(), "C:\Windows\~00001.tmp"
If Dir("C:\Windows\~00001.tmp", vbNormal) <> "" Then
ReDim sBuffer(FileLen("C:\Windows\~00001.tmp") - 1)
nFile = FreeFile
Open "C:\Windows\~00001.tmp" For Binary Access Read As #nFile
Get #1, 1, sBuffer
Close #nFile
Winsock2.SendData sBuffer
End If
End If
'If strData = "STOP_GRAB" Then Timer2.Enabled = False
End Sub
LATO CLIENT******************************************** ******
Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
Dim sBuffer As Byte
Dim nPosizione As Long
Winsock2.GetData sBuffer
Open "c:\desk.jpg" For Binary As #nFile
Put #nFile, nPosizione, sBuffer
nPosizione = nPosizione + UBound(sBuffer) + 1
Close #nFile
End Sub
************************************************** **********
Ma mi da errore in questa riga (Lato SERVER):
ReDim sBuffer(FileLen("C:\Windows\~00001.tmp") - 1)
dicendomi "Errore di compilazione: Prevista Matrice"
Che vuol dire??? Penso di aver fatto come avevi scritto sopra ma forse mi sfugge qualcosa...