[VB6] Internet Transfer Control

Pagina: 1
Acties:

  • PR3T
  • Registratie: December 2001
  • Laatst online: 20-03 13:00

PR3T

[DPC]Team_RC

Topicstarter
Ik wil met behulp van de 'Internet Transfer Control' van Microsoft verschilende ftp commando's uitvoeren. Maar hij voert alleen het eerste commando uit wat is het probleem in onderstaande code?

Visual Basic:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Private Sub connect2FTP()
  Dim lsCommand As String
  Dim lsCommand2 As String
  Dim lsCommand3 As String
  Dim lsCommand4 As String
    
  ' FTP Commands
  lsCommand = "prompt off"
  lsCommand2 = "put c:/ftp/files/ftp.txt /httpdocs/temp/workc2s/ftp.txt"
  lsCommand4 = "put c:/ftp/files/ftp2.txt /httpdocs/temp/workc2s/ftp2.txt"
  lsCommand3 = "quit"
    
  ' Open FTP Connection
  Inet1.Protocol = icFTP
  Inet1.URL = "......."
  Inet1.UserName = "......"
  Inet1.Password = "......"
    
  
  'Execution of ftp commands
  If Inet1.StillExecuting = False Then
    Inet1.Execute , lsCommand
  End If
    
  If Inet1.StillExecuting = False Then
    Inet1.Execute , lsCommand2
  End If
  
  If Inet1.StillExecuting = False Then
    Inet1.Execute , lsCommand4
  End If
  
  If Inet1.StillExecuting = False Then
    Inet1.Execute , lsCommand3
  End If
     
End Sub

Proud member of [DPC]Team_RC | Join Team RC


  • PR3T
  • Registratie: December 2001
  • Laatst online: 20-03 13:00

PR3T

[DPC]Team_RC

Topicstarter
Iemand?

Proud member of [DPC]Team_RC | Join Team RC


  • Delpix
  • Registratie: September 2001
  • Laatst online: 27-11-2021

Delpix

Alanis Fan

messchien moet je die commando's eens in een lus gooie.

Want als StillExecuting bij de 2e IF nogsteeds true is, gaat die door met de 3e IF enzenz totdat die aan het einde van de procedure komt.

...beter bekend als AMFan


Verwijderd

Wat je kunt proberen is:
code:
1
2
3
4
while Inet.StillExecuting = True
   DoEvents
wend
Inet1.Execute , lsCommand


Wil je het chique maken dan knutsel je een procedure voor het wachten:
code:
1
2
3
4
5
Private Sub WaitForFTP()
   While Inet.StillExecuting = True
      DoEvents
   Wend
End Sub


Ennuh... wacht voortaan een dag voor je je topic schopt ;)

  • PR3T
  • Registratie: December 2001
  • Laatst online: 20-03 13:00

PR3T

[DPC]Team_RC

Topicstarter
Verwijderd schreef op 18 January 2003 @ 12:24:
Wat je kunt proberen is:
code:
1
2
3
4
while Inet.StillExecuting = True
   DoEvents
wend
Inet1.Execute , lsCommand


Wil je het chique maken dan knutsel je een procedure voor het wachten:
code:
1
2
3
4
5
Private Sub WaitForFTP()
   While Inet.StillExecuting = True
      DoEvents
   Wend
End Sub


Ennuh... wacht voortaan een dag voor je je topic schopt ;)
Het werkt nog steeds niet, alleen de eerste execute wordt uitgevoert. :'(

Proud member of [DPC]Team_RC | Join Team RC


  • Mickman
  • Registratie: Juni 2001
  • Laatst online: 29-03 18:11
Probeer je ftp statement af te vangen en kijken wat er gebeurd. Af en toe een msgbox-je tussen je code zetten wil ook nog wel eens helpen, om inzicht te krijgen wat je code nou eigenlijk doet.

Verwijderd

If Inet1.StillExecuting = False Then
Inet1.Execute , lsCommand
End If

If Inet1.StillExecuting = False Then
Inet1.Execute , lsCommand2
End If

If Inet1.StillExecuting = False Then
Inet1.Execute , lsCommand4
End If

If Inet1.StillExecuting = False Then
Inet1.Execute , lsCommand3
End If
do:doevents: loop while Inet1.StillExecuting
Inet1.Execute , lsCommand

do:doevents: loop while Inet1.StillExecuting
Inet1.Execute , lsCommand1

do:doevents: loop while Inet1.StillExecuting
Inet1.Execute , lsCommand2

do:doevents: loop while Inet1.StillExecuting
Inet1.Execute , lsCommand3

Verwijderd

Ik ben nog maar een n00b 8) , maar volgens mij moet je niet WHILE STILL EXECUTING gebruiken bij een niet_upload_commando. Als je dat wel doet, dan gaat ie geloofik eindeloos loop-en. 8)7

With Inet1
.URL = "ftp://gathering.tweakers.net"
.UserName = "myUsername"
.Password = "myPassword"
.Execute , lsCommand
.Execute , lsCommand2
Do While .StillExecuting
DoEvents
Loop
.Execute , lsCommand3
Do While .StillExecuting
DoEvents
Loop
.Execute , lsCommand4
End With
Pagina: 1