[VB6] Internet Transfer Control, 2 keer inloggen.

Pagina: 1
Acties:

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

PR3T

[DPC]Team_RC

Topicstarter
Ik ben bezig met het opzetten van een ftp connectie met de 'Internet Transfer Control' van VB6.

Het is me gelukt om een connectie op te zetten, door het inloggen met anonymous.
Maar daarna wil ik nog een keer kunnen inloggen, een zogenaamde sublogin. Is dit uberhaubt mogelijk. Hieronder mijn 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
Private Sub connect2FTP()
  
  Dim lsDirList As String
   
  Inet1.Protocol = icFTP
  Inet1.URL = "ftp.blaat.nl"
  Inet1.UserName = "anonymous"
  Inet1.Password = "anonymous"
  
   
  Text1.Text = "[OPEN] Connection " & vbCrLf & Text1.Text
  
  executeCommand ("ls")
  waitCommand
    
  lsDirList = Inet1.GetChunk(1024, icString)
  
  Text1.Text = "[LS]: " & lsDirList & vbCrLf & Text1.Text
  
   
  'waitCommand
  'executeCommand ("user test")
  'waitCommand
  'executeCommand ("test")
  'waitCommand
    
End Sub


De bovenstaande code werkt, ik wil echter nog een keer inloggen met gebruiker test, dit werkt echter niet (zie gecommentarieerde code). Wat is er mis?

Proud member of [DPC]Team_RC | Join Team RC


  • whoami
  • Registratie: December 2000
  • Laatst online: 12:26
IMHO is het logisch dat het niet lukt. 'k Heb geen ervaring met die control of zelfs met VB, maar een sessie kan toch niet gedeeld worden? Je kunt toch maar per sessie met 1 gebruiker tegelijk inloggen?
Als je nu een nieuwe connectie gaat maken, dan zal het wel lukken, maar bij uw voorbeeld lijkt het me gewoon juist als het niet werkt zoals jij dat wilt.

https://fgheysels.github.io/


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

PR3T

[DPC]Team_RC

Topicstarter
whoami schreef op 27 januari 2003 @ 11:04:
IMHO is het logisch dat het niet lukt. 'k Heb geen ervaring met die control of zelfs met VB, maar een sessie kan toch niet gedeeld worden? Je kunt toch maar per sessie met 1 gebruiker tegelijk inloggen?
Als je nu een nieuwe connectie gaat maken, dan zal het wel lukken, maar bij uw voorbeeld lijkt het me gewoon juist als het niet werkt zoals jij dat wilt.
Dus wil ook niet 2 keer connecten, Ik wil alleen eerst inloggen met anonymous en vervolgens nogmaals inloggen in dezelfde sessie om in mijn eigen werkdirectory te komen.

Proud member of [DPC]Team_RC | Join Team RC


  • Mickman
  • Registratie: Juni 2001
  • Laatst online: 29-03 18:11
Doe je dat met een ander FTP programma ook ofzo???
Misschien dat het lukt met een nieuwe instantie van ITC, en dus nieuwe sessie.
FTP server moet het natuurlijk ook ondersteunen.

Maar als je uiteindelijk toch in je eigen werkdirectory wilt komen, waarom log je dan niet gelijk in met je username?

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

PR3T

[DPC]Team_RC

Topicstarter
Mickman schreef op 27 januari 2003 @ 12:58:
Doe je dat met een ander FTP programma ook ofzo???
Misschien dat het lukt met een nieuwe instantie van ITC, en dus nieuwe sessie.
FTP server moet het natuurlijk ook ondersteunen.

Maar als je uiteindelijk toch in je eigen werkdirectory wilt komen, waarom log je dan niet gelijk in met je username?
Omdat dat niet kan, ik moet eerst inloggen met anonymous voordat ik kan inloggen met mijn eigen username en wachtwoord.
Liever log ik ook gelijk in dan was het geen probleem geweest, maar de server waar ik op moet inloggen vereist eerst een anonymous login waarna je op de server met je eigen username en wachtwoord kan inloggen.

Proud member of [DPC]Team_RC | Join Team RC


  • whoami
  • Registratie: December 2000
  • Laatst online: 12:26
PR3T schreef op 27 January 2003 @ 13:07:
[...]


Omdat dat niet kan, ik moet eerst inloggen met anonymous voordat ik kan inloggen met mijn eigen username en wachtwoord.
Liever log ik ook gelijk in dan was het geen probleem geweest, maar de server waar ik op moet inloggen vereist eerst een anonymous login waarna je op de server met je eigen username en wachtwoord kan inloggen.


Dat is wel heel vreemd. Anonieme logon's zijn toegestaan, en andere niet??
Heb je het al eens geprobeerd?

[ Voor 10% gewijzigd door whoami op 27-01-2003 13:14 ]

https://fgheysels.github.io/


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

PR3T

[DPC]Team_RC

Topicstarter
whoami schreef op 27 januari 2003 @ 13:14:

[...]


Dat is wel heel vreemd. Anonieme logon's zijn toegestaan, en andere niet??
Heb je het al eens geprobeerd?
Ja natuurlijk. Maar volgens het document dat ik van TPG Post heb gehad kan alleen ingelogd worden met anonymous. Als je dat gedaan hebt dan kun je pas inloggen met je eigen login. Zoals ik al 3 keer eerder beschreven heb.
Waarschijnlijk is dit gedaan voor extra beveiliging ofzo.

[ Voor 3% gewijzigd door PR3T op 27-01-2003 13:22 ]

Proud member of [DPC]Team_RC | Join Team RC


  • whoami
  • Registratie: December 2000
  • Laatst online: 12:26
PR3T schreef op 27 januari 2003 @ 13:21:
[...]
Zoals ik al 3 keer eerder beschreven heb.
Waarschijnlijk is dit gedaan voor extra beveiliging ofzo.


* whoami vind daar niets extra veiligs aan , maar goed....

Hoe moet je dat dan doen, als je manueel inlogt op die ftp server?

https://fgheysels.github.io/


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

PR3T

[DPC]Team_RC

Topicstarter
whoami schreef op 27 January 2003 @ 13:23:

[...]


* whoami vind daar niets extra veiligs aan , maar goed....

Hoe moet je dat dan doen, als je manueel inlogt op die ftp server?
user <username>
<password>

Proud member of [DPC]Team_RC | Join Team RC


  • Mickman
  • Registratie: Juni 2001
  • Laatst online: 29-03 18:11
Nou ik heb wat zitten rommelen in Visual Basic, volgens mij is de enige mogelijkheid om nog een ITC component te gebruiken. Hoewel in de MSDN library de volgende error code van ITC terug te vinden is: icOutOfHandles 35767 "Out of handles".
Je zou denken dat je dus per Internet Transfer Control meerdere handles zou kunnen gebruiken. Meer weet ik ook niet

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

PR3T

[DPC]Team_RC

Topicstarter
Mickman schreef op 27 januari 2003 @ 13:30:
Nou ik heb wat zitten rommelen in Visual Basic, volgens mij is de enige mogelijkheid om nog een ITC component te gebruiken. Hoewel in de MSDN library de volgende error code van ITC terug te vinden is: icOutOfHandles 35767 "Out of handles".
Je zou denken dat je dus per Internet Transfer Control meerdere handles zou kunnen gebruiken. Meer weet ik ook niet
Het probleem is dat ik met de execute methode gebonden ben aan de volgende commando's: cd,cdup,close,delete,dir,get,ls,mkdir,put,pwd,quit,recv,rename,rmdir,send,size.

Maar ik wil echter het 'user' commando gebruiken om de 2e login te doen. Dit lukt echter niet. Is het uberhaubt mogelijk met de 'Internet Tranfer Control'???? :'(

Proud member of [DPC]Team_RC | Join Team RC


  • Mickman
  • Registratie: Juni 2001
  • Laatst online: 29-03 18:11
Misschien heb je hier wat aan (ben aan het werk, dus kan moeilijk alle tijd hieraan besteden :))


Closing a Session
The session will remain active until you explicitly close it with the Quit or Close commands. If you used the Quit command to log on as a different user, then you need to update the values in UserName and Password properties before you issue the next command.


Issuing FTP Commands
The Internet Transfer control will automatically establish an FTP session the first time you execute an FTP command. Table 11.5 lists the FTP commands for the control.

Table 11.5: FTP Commands for the Internet Transfer Control

FTP Command Description
CD dir Changes the current directory to the specified directory on the remote computer
CDUP Changes the current directory to the parent directory on the remote computer
CLOSE Closes the connection to the remote computer
DELETE file Deletes the specified file on the remote computer
DIR [dir] Returns the list of files from the specified directory (use GetChunk to get the information)
GET file1 file2 Retrieves the specified file (file1) from the remote computer and saves it as the specified file (file2) on the local computer
LS [dir] Same as DIR
MKDIR dir Creates the specified directory on the remote computer
PUT file1 file2 Sends the specified file (file1) from the local computer and saves it as the specified file (file2) on the remote computer
PWD Returns the current directory from the remote computer (use GetChunk to get the information)
QUIT Terminates the current user’s session on the remote computer
RECV file1 file2 Same as GET
RENAME file1 file2 Changes the name of the specified file (file1) to the specified name (file2) on the remote computer
RMDIR dir Deletes the specified directory
SEND file1 file2 Same as PUT
SIZE dir Returns the size of the specified directory (use GetChunk to get the information)

WARNING: Security, security, security: Just because a command is listed here does not mean it can be used. Your user name and password will determine your level of access to the files on the server, as well as which commands you will be able to execute.

gevonden op http://msdn.microsoft.com...ml/issuingftpcommands.asp

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

PR3T

[DPC]Team_RC

Topicstarter
Mickman schreef op 27 January 2003 @ 14:35:
Misschien heb je hier wat aan (ben aan het werk, dus kan moeilijk alle tijd hieraan besteden :))


Closing a Session
The session will remain active until you explicitly close it with the Quit or Close commands. If you used the Quit command to log on as a different user, then you need to update the values in UserName and Password properties before you issue the next command.


Issuing FTP Commands
The Internet Transfer control will automatically establish an FTP session the first time you execute an FTP command. Table 11.5 lists the FTP commands for the control.

Table 11.5: FTP Commands for the Internet Transfer Control

FTP Command Description
CD dir Changes the current directory to the specified directory on the remote computer
CDUP Changes the current directory to the parent directory on the remote computer
CLOSE Closes the connection to the remote computer
DELETE file Deletes the specified file on the remote computer
DIR [dir] Returns the list of files from the specified directory (use GetChunk to get the information)
GET file1 file2 Retrieves the specified file (file1) from the remote computer and saves it as the specified file (file2) on the local computer
LS [dir] Same as DIR
MKDIR dir Creates the specified directory on the remote computer
PUT file1 file2 Sends the specified file (file1) from the local computer and saves it as the specified file (file2) on the remote computer
PWD Returns the current directory from the remote computer (use GetChunk to get the information)
QUIT Terminates the current user’s session on the remote computer
RECV file1 file2 Same as GET
RENAME file1 file2 Changes the name of the specified file (file1) to the specified name (file2) on the remote computer
RMDIR dir Deletes the specified directory
SEND file1 file2 Same as PUT
SIZE dir Returns the size of the specified directory (use GetChunk to get the information)

WARNING: Security, security, security: Just because a command is listed here does not mean it can be used. Your user name and password will determine your level of access to the files on the server, as well as which commands you will be able to execute.

gevonden op http://msdn.microsoft.com...ml/issuingftpcommands.asp
Ja dat werkt dus ook niet, want als het quit commando uitvoerd dan verbreek je de anonymous sessie. En kun je dus niet inloggen met je eigen login, het enige dat dan werkt is om weer in te loggen als anonymous. :'(

Proud member of [DPC]Team_RC | Join Team RC


  • Mickman
  • Registratie: Juni 2001
  • Laatst online: 29-03 18:11
Met een standaard FTP programma start je dus gewoon een nieuwe sessie???
Zoiets als FlashFXP of wat dan ook.

Probeer je toch een nieuwe instantie van je Form
(ik heb maar wat namen gebruikt, maar je zal het wel snappen)

Dim form as Form1
form.Inet1.username = nieuwe username
form.Inet1.password = nieuw password
form.Show

kijken of je dan met een extra sessie kan werken.

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

PR3T

[DPC]Team_RC

Topicstarter
Mickman schreef op 27 January 2003 @ 15:11:
Met een standaard FTP programma start je dus gewoon een nieuwe sessie???
Zoiets als FlashFXP of wat dan ook.

Probeer je toch een nieuwe instantie van je Form
(ik heb maar wat namen gebruikt, maar je zal het wel snappen)

Dim form as Form1
form.Inet1.username = nieuwe username
form.Inet1.password = nieuw password
form.Show

kijken of je dan met een extra sessie kan werken.
Nee dat werkt ook niet, wordt een beetje moedeloos van dat 'internet transfer controlletje' ;(

Proud member of [DPC]Team_RC | Join Team RC


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

PR3T

[DPC]Team_RC

Topicstarter
Is er misschien een andere manier binnen vb6 om een ftp connectie, en ftp commando's uit te voeren i.p.v. met de 'internet transfer control'?

[ Voor 11% gewijzigd door PR3T op 27-01-2003 16:27 ]

Proud member of [DPC]Team_RC | Join Team RC


  • Mickman
  • Registratie: Juni 2001
  • Laatst online: 29-03 18:11
Ik heb hier een mogelijkheid gevonden om met de winsock control ftp te gebruiken
Misschien dat je hier wel meerdere sessies te gelijk kan hebben

http://www.vbip.com/winsock/winsock_ftp_01.asp

Ergens anders heb ik ook iets gelezen over een controlled array van winsock componenten.
Winsock(0) verbinden met anonymous
Winsock(1) verbinden met user
Winsock(1) sluiten user
Winsock(0) sluiten

Misschien dat je dat ook wel kan gebruiken bij ITC.

[ Voor 7% gewijzigd door Mickman op 27-01-2003 16:00 ]

Pagina: 1