Article ID: 173264
Article Last Modified on 2/10/2005
173265 : BUG: Internet Transfer Control (SP2) Username and Password
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim vtData As Variant ' Data variable.
Select Case State
' ... Other cases not shown.
Case icError ' 11
' In case of error, return ResponseCode and
' ResponseInfo.
vtData = Inet1.ResponseCode & ":" & _
Inet1.ResponseInfo
Case icResponseCompleted ' 12
Dim strData As String: strData = ""
Dim bDone As Boolean: bDone = False
' Get first chunk.
vtData = Inet1.GetChunk(1024, icString)
DoEvents
Do While Not bDone
strData = strData & vtData
' Get next chunk.
vtData = Inet1.GetChunk(1024, icString)
DoEvents
If Len(vtData) = 0 Then
bDone = True
End If
Loop
MsgBox strData
End Select
End Sub
Private Sub Command1_Click()
Inet1.UserName = "Username"
Inet1.Password = "Password"
Inet1.URL = "ftp://YourFTPServer"
Inet1.Execute , "DIR"
End Sub
Keywords: kbhowto kbinetdev KB173264