21/02/07 18:27
P4p3r0g4
non lo uso mai. preferisco interrompere e reiniziare tutto da capo. così non ci sono bug.
aaa
21/02/07 19:48
Grazie per le tue varie risposte..
Continuando il progettino, nonostante abbia letto le precedenti note.. sulla questione Bug!
ti posto quello che mi é venuto in mente..
Client:
Private Sub download_Click()
On Error Resume Next
If winsock.State = sckConnected Then
winsock.SendData "down" + "c:\file.txt"
End If
End Sub
Nei Dati in Arrivo
Dim POZIZIONE As Integer
Dim data2 As String
Dim Data As String
Dim NomeFile As String
Dim DIMENSIONE As Long
Dim FileDaSalvere As String
winsock.GetData Data, vbString
data2 = Left(Data, 2)
Select Case data2
Case "down"
StrTOT = Mid(Data, 3)
POSIZIONE = 0
While InStr(POSIZIONE + 1, StrTOT, " " > 0
POSIZIONE = InStr(POSIZIONE + 1, StrTOT, " "
Wend
NomeFile = "c:\file.txt"
NomeFile = Left(StrTOT, POSIZIONE - 1)
DIMENSIONE = CLng(Mid(StrTOT, POSIZIONE + 1))
File2 = "down"
File2 = FreeFile
If dir(NomeFile) <> "" Then
FileDaSalvare = App.Path & "\" & NomeFile
Kill FileDaSalvare
End If
Open App.Path & "\" & NomeFile For Binary As "down"
End If
Case "FN"
Close #1
Case Else
Put "down", , Data
End Select
"down" é il pacchettino che mi dicevi
Anche se quello che non capisco é.. io voglio scaricare il file che ho selezionato!
In questo caso il Server, dovrebbe andare nell'unità C: e aprire il file file.txt. Ma come ti dicevo io vorrei aprire il file selezionato nel List2, come nel progetto!
vado avanti..
Server:
dim Data As String
dim data2 As String
dim POSIZIONE As Integer
dim NomeFile As String
dim FileDaSalvare As String
Dim DatiChat As String
Dim As Double
j As Double
k As Double
h As Double
Dim DimensioneFile As Long
Private Const chunk = 8000
winsock.GetData Data, vbString
data2 = Left(Data, 2)
Select Case data2
Case "down"
Open "c:\file.txt" For Binary As "down"
k = (DimensioneFile \ 8000) + 1
Do While Not EOF("down"
i = i + 1
Data = Input(chunk, "down"
winsock.SendData Data
DoEvents
Loop
winsock.SendData "FN"
Close "down"
End Select
Ci ho provato!!
Mandando il pacchettino "down" al Server
Grazie ancora per la tua gentilezza
Continuando il progettino, nonostante abbia letto le precedenti note.. sulla questione Bug!
ti posto quello che mi é venuto in mente..
Client:
Private Sub download_Click()
On Error Resume Next
If winsock.State = sckConnected Then
winsock.SendData "down" + "c:\file.txt"
End If
End Sub
Nei Dati in Arrivo
Dim POZIZIONE As Integer
Dim data2 As String
Dim Data As String
Dim NomeFile As String
Dim DIMENSIONE As Long
Dim FileDaSalvere As String
winsock.GetData Data, vbString
data2 = Left(Data, 2)
Select Case data2
Case "down"
StrTOT = Mid(Data, 3)
POSIZIONE = 0
While InStr(POSIZIONE + 1, StrTOT, " " > 0
POSIZIONE = InStr(POSIZIONE + 1, StrTOT, " "
Wend
NomeFile = "c:\file.txt"
NomeFile = Left(StrTOT, POSIZIONE - 1)
DIMENSIONE = CLng(Mid(StrTOT, POSIZIONE + 1))
File2 = "down"
File2 = FreeFile
If dir(NomeFile) <> "" Then
FileDaSalvare = App.Path & "\" & NomeFile
Kill FileDaSalvare
End If
Open App.Path & "\" & NomeFile For Binary As "down"
End If
Case "FN"
Close #1
Case Else
Put "down", , Data
End Select
"down" é il pacchettino che mi dicevi
Anche se quello che non capisco é.. io voglio scaricare il file che ho selezionato!
In questo caso il Server, dovrebbe andare nell'unità C: e aprire il file file.txt. Ma come ti dicevo io vorrei aprire il file selezionato nel List2, come nel progetto!
vado avanti..
Server:
dim Data As String
dim data2 As String
dim POSIZIONE As Integer
dim NomeFile As String
dim FileDaSalvare As String
Dim DatiChat As String
Dim As Double
j As Double
k As Double
h As Double
Dim DimensioneFile As Long
Private Const chunk = 8000
winsock.GetData Data, vbString
data2 = Left(Data, 2)
Select Case data2
Case "down"
Open "c:\file.txt" For Binary As "down"
k = (DimensioneFile \ 8000) + 1
Do While Not EOF("down"
i = i + 1
Data = Input(chunk, "down"
winsock.SendData Data
DoEvents
Loop
winsock.SendData "FN"
Close "down"
End Select
Ci ho provato!!
Mandando il pacchettino "down" al Server
Grazie ancora per la tua gentilezza
22/02/07 13:03
P4p3r0g4
mi sono un po perso co i codici. utilizzi troppe variabili.
xò non ho ben capito
come può essere data2 = "down"?
xò non ho ben capito
data2 = Left(Data, 2) Select Case data2 Case "down"
come può essere data2 = "down"?
aaa
22/02/07 13:36
grazie per la tua risposta..
Infatti ho utilizzato troppe variabili poiché, come ben sai ci ho provato..
Si ho scritto..
variabili:
Dim data2 As String
Dim Data As String
Si potrebbe anche essere, la variabile
data2 = "down"
ho voluto un pò far delle cose + particolari dato le circostanze..
Direi che queste plus variabili se non si vedono con calma, uno potrebbe smarrirsi
Ci sono andato vicino?
Qualche infarinatura..
Grazie ancora..
Infatti ho utilizzato troppe variabili poiché, come ben sai ci ho provato..
Si ho scritto..
variabili:
Dim data2 As String
Dim Data As String
Si potrebbe anche essere, la variabile
data2 = "down"
ho voluto un pò far delle cose + particolari dato le circostanze..
Direi che queste plus variabili se non si vedono con calma, uno potrebbe smarrirsi
Ci sono andato vicino?
Qualche infarinatura..
Grazie ancora..
22/02/07 19:05
P4p3r0g4
data2 = Left(Data, 2) Select Case data2 Case "down"
ma non può essere "down" al massimo "do" se prendi left(x,2)
aaa
22/02/07 22:21
data2 = Left(Data, 2)
Select Case data2
Case "down"
ma non può essere "down" al massimo "do" se prendi left(x,2)
grazie ancora per le tue risposte..
ma il codice é giusto? Nel senso quello che t'ho inserito in precedente é giusto secondo te?
Non pensavo che nell'istruzione
data2 = Left(Data, 2)
Select Case data2
Case "down"
dovevo mettere, max due caratteri, quanto il 2
Del resto che ne pensi?
Select Case data2
Case "down"
ma non può essere "down" al massimo "do" se prendi left(x,2)
grazie ancora per le tue risposte..
ma il codice é giusto? Nel senso quello che t'ho inserito in precedente é giusto secondo te?
Non pensavo che nell'istruzione
data2 = Left(Data, 2)
Select Case data2
Case "down"
dovevo mettere, max due caratteri, quanto il 2
Del resto che ne pensi?
22/02/07 22:27
grazie ancora per le tue risposte.. come sempre
Client:
Private Sub download_Click()
On Error Resume Next
If winsock.State = sckConnected Then
winsock.SendData "down" + "c:\file.txt"
End If
End Sub
Nei Dati in Arrivo
Dim POZIZIONE As Integer
Dim data2 As String
Dim Data As String
Dim NomeFile As String
Dim DIMENSIONE As Long
Dim FileDaSalvere As String
winsock.GetData Data, vbString
data2 = Left(Data, 2)
Select Case data2
Case "down"
StrTOT = Mid(Data, 3)
POSIZIONE = 0
While InStr(POSIZIONE + 1, StrTOT, " " > 0
POSIZIONE = InStr(POSIZIONE + 1, StrTOT, " "
Wend
NomeFile = "c:\file.txt"
NomeFile = Left(StrTOT, POSIZIONE - 1)
DIMENSIONE = CLng(Mid(StrTOT, POSIZIONE + 1))
File2 = "down"
File2 = FreeFile
If dir(NomeFile) <> "" Then
FileDaSalvare = App.Path & "\" & NomeFile
Kill FileDaSalvare
End If
Open App.Path & "\" & NomeFile For Binary As "down"
End If
Case "FN"
Close #1
Case Else
Put "down", , Data
End Select
"down" é il pacchettino che mi dicevi
Anche se quello che non capisco é.. io voglio scaricare il file che ho selezionato!
In questo caso il Server, dovrebbe andare nell'unità C: e aprire il file file.txt. Ma come ti dicevo io vorrei aprire il file selezionato nel List2, come nel progetto!
vado avanti..
Server:
dim Data As String
dim data2 As String
dim POSIZIONE As Integer
dim NomeFile As String
dim FileDaSalvare As String
Dim DatiChat As String
Dim As Double
j As Double
k As Double
h As Double
Dim DimensioneFile As Long
Private Const chunk = 8000
winsock.GetData Data, vbString
data2 = Left(Data, 4)
Select Case data2
Case "down"
Open "c:\file.txt" For Binary As "down"
k = (DimensioneFile \ 8000) + 1
Do While Not EOF("down"
i = i + 1
Data = Input(chunk, "down"
winsock.SendData Data
DoEvents
Loop
winsock.SendData "FN"
Close "down"
End Select
quindi secondo te, questo sarebbe un giusto codice?
quello che non capisco é..
Nel Client io seleziono un file tra tanti che me ne compaiono nel List2.. seleziono il file e clicco sul Command Button..
parte il pacchetto denominato "down"
Server, in ricezione.. mi va a leggere "c:\file.txt"..
fin qui ci sono!!! Ma..
Credo che il tutto sia un esempio.. ma nel vero gergo come dovrei comportarmi???
Nel senso
Nel Client dovrebbe essere specificato List2, selezionato e quindi
List2.Selected o qualcosa di simile
Oppure con l'istruzione
winsock.SendData "down" + "c:\file.txt"
quest'ultimo dovrebbe essere ?? perché dovrebbe corrispondere al file che ho selezionato..
e quindi risalire al Server e prelevare il file
questi sono dei miei commenti
grazie ancora.. per le tue risposte..
Client:
Private Sub download_Click()
On Error Resume Next
If winsock.State = sckConnected Then
winsock.SendData "down" + "c:\file.txt"
End If
End Sub
Nei Dati in Arrivo
Dim POZIZIONE As Integer
Dim data2 As String
Dim Data As String
Dim NomeFile As String
Dim DIMENSIONE As Long
Dim FileDaSalvere As String
winsock.GetData Data, vbString
data2 = Left(Data, 2)
Select Case data2
Case "down"
StrTOT = Mid(Data, 3)
POSIZIONE = 0
While InStr(POSIZIONE + 1, StrTOT, " " > 0
POSIZIONE = InStr(POSIZIONE + 1, StrTOT, " "
Wend
NomeFile = "c:\file.txt"
NomeFile = Left(StrTOT, POSIZIONE - 1)
DIMENSIONE = CLng(Mid(StrTOT, POSIZIONE + 1))
File2 = "down"
File2 = FreeFile
If dir(NomeFile) <> "" Then
FileDaSalvare = App.Path & "\" & NomeFile
Kill FileDaSalvare
End If
Open App.Path & "\" & NomeFile For Binary As "down"
End If
Case "FN"
Close #1
Case Else
Put "down", , Data
End Select
"down" é il pacchettino che mi dicevi
Anche se quello che non capisco é.. io voglio scaricare il file che ho selezionato!
In questo caso il Server, dovrebbe andare nell'unità C: e aprire il file file.txt. Ma come ti dicevo io vorrei aprire il file selezionato nel List2, come nel progetto!
vado avanti..
Server:
dim Data As String
dim data2 As String
dim POSIZIONE As Integer
dim NomeFile As String
dim FileDaSalvare As String
Dim DatiChat As String
Dim As Double
j As Double
k As Double
h As Double
Dim DimensioneFile As Long
Private Const chunk = 8000
winsock.GetData Data, vbString
data2 = Left(Data, 4)
Select Case data2
Case "down"
Open "c:\file.txt" For Binary As "down"
k = (DimensioneFile \ 8000) + 1
Do While Not EOF("down"
i = i + 1
Data = Input(chunk, "down"
winsock.SendData Data
DoEvents
Loop
winsock.SendData "FN"
Close "down"
End Select
quindi secondo te, questo sarebbe un giusto codice?
quello che non capisco é..
Nel Client io seleziono un file tra tanti che me ne compaiono nel List2.. seleziono il file e clicco sul Command Button..
parte il pacchetto denominato "down"
Server, in ricezione.. mi va a leggere "c:\file.txt"..
fin qui ci sono!!! Ma..
Credo che il tutto sia un esempio.. ma nel vero gergo come dovrei comportarmi???
Nel senso
Nel Client dovrebbe essere specificato List2, selezionato e quindi
List2.Selected o qualcosa di simile
Oppure con l'istruzione
winsock.SendData "down" + "c:\file.txt"
quest'ultimo dovrebbe essere ?? perché dovrebbe corrispondere al file che ho selezionato..
e quindi risalire al Server e prelevare il file
questi sono dei miei commenti
grazie ancora.. per le tue risposte..