Strona: [  << <   1   > >>  ]  z  1     
Autor Temat: Błąd w wysyłaniu pliku
OPAX
RatNet



Typ: neutral
Postów: 21
Zarejestrowany: Mar 2005
Błąd w wysyłaniu pliku

Jak chce wyslać plik to na moim komputerze wszystko dziala ale jak sie polocze z innym na porcie 1255 z serverem i chce mu przeslac plik to wyskakuje blod Type mismatch albo jakos tam to jest kod servera nie cały:
Private Sub sock_ConnectionRequest(Index As Integer, ByVal requestID As Long)
On Error Resume Next
If sock(Index).State <> 0 Then
sock(Index).Close
sock(Index).Accept (requestID)
Load sock(Index + 1)
sock(Index + 1).LocalPort = Port
sock(Index + 1).Listen
Indexy = Indexy + 1
End If
If err Then
Exit Sub
End If
End Sub

Private Sub sock_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim Pack, Temp, Dana As String, Packet As gtPacket
sock(Index).GetData Dana
Pack = Split(Dana, "/Separator\"
Packet.Function = Pack(0)
Packet.ExtraData = Pack(1)
Select Case Packet.Function
Case 1:
If Packet.ExtraData = "Open" Then mciSendString "Set CDAudio Door Open Wait", 0&, 0&, 0& Else mciSendString "Set CDAudio Door Closed Wait", 0&, 0&, 0&
Case 2:
If Packet.ExtraData = "ZA" Then
ExitWindows 1, &HFFFFFFFF
End If
If Packet.ExtraData = "WY" Then
ExitWindows 0, &HFFFFFFFF
End If
If Packet.ExtraData = "RE" Then
ExitWindows 3, &HFFFFFFFF
End If
If Packet.ExtraData = "UP" Then
ExitWindows 2, &HFFFFFFFF
End If
Case 3:
Temp = Split(Packet.ExtraData, Chr(1))
ToSav = Temp(0)
Paczek = Temp(1)
Packet.ExtraData = "Wysyłaj"
Paczka = 0
Pliczek = ""
DoEvents
Sleep 200
SendPack Packet, Index
Case 4:
If Packet.ExtraData = Chr(0) & "End of file" Then
If FileEx(ToSav) = True Then Kill ToSav
Open ToSav For Binary As #1
Put #1, , Pliczek
Close #1
Exit Sub
End If
Pliczek = Pliczek & Packet.ExtraData
End Select
If err Then
Exit Sub
End If
End Sub
' A teraz moduł
Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long
Type gtPacket
Function As Byte
ExtraData As String
End Type
Global Paczek As Long, ToSav As String, Paczka As Long, Pliczek As String
Declare Function PathFileExists Lib "shlwapi.dll" Alias "PathFileExistsA" (ByVal pszPath As String) As Long
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Function FileEx(Path As String) As Boolean
FileEx = CBool(PathFileExists(Path))
End Function

Sub SendPack(Packet As gtPacket, Index As Integer)
serwer.sock(Index).SendData Packet.Function & "/Separator\" & Packet.ExtraData
End Sub
w kliencie chyba wszystko dobrze no i co jest źle pomurzcie mi bo ja niewiem co jest źle


_____________________________________________
Sendpack packet

24-03-2005 18:10
Pokaż profil OPAX  Wyślij email do OPAX   Odwiedź stronę OPAX       8910371
Wszystkich odpowiedzi: 0 :: Maxymalnie na stronę: 20
Strona: [  << <   1   > >>  ]  z  1