FileListBox Frage

simiswiss
Hallo zusammen

ich bin grade dran, das FTP-Beispiel von Microsoft umzuschreiben.
(siehe http://support.microsoft.com/kb/175179/de)
ich möchte, dass wenn man mehrere files in der filelistbox zum upload markiert, auch alle raufgeladen werden. derzeit wird nur 1 (das zuletzt markierte) file raufgeladen.

Die FileListBox heisst File1

ich dachte mir, es geht in die richtung:

code:
1:
2:
3:
4:
For Each File1 In File1.Selected
*upload*
Exit For
Next File1


oder muss ich einfach alle einträge nehmen und dann überprüfen, ob es markiert ist?
etwa so:

code:
1:
2:
3:
4:
5:
6:
7:
8:
For Each File1 in *weissauchnicht*
If File1.Selected = true
*upload*
Exit For
End If

Next File1



danke jetzt schon für eure Hilfe!
lg simon
simiswiss
ich habe in einem andern Forum den Code dafür gefunden.
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
Sub FuegeSelektierteEintrageHinzu()
Dim i As Long

For i = 0 To File1.ListCount - 1
If File1.Selected(i) Then
ExperimentBox.AddItem Dir1.Path & "\" & File1.List(i)
End If
Next i
End Sub

er funzt, ich habs mit nem test mit MsgBox'es gemacht - für jedes selektiertes file eine MsgBox.

aber ich schaff es nicht, diese nun auch raufzuladen...

hier der code, der normalerweise verwendet wird:

code:
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:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
Private Sub cmdPut_Click()
    Dim bRet As Boolean
    Dim szFileRemote As String, szDirRemote As String, szFileLocal As String
    Dim szTempString As String
    Dim nPos As Long, nTemp As Long
    Dim nodX As Node
    Set nodX = TreeView1.SelectedItem
  


    If bActiveSession Then
        If nodX Is Nothing Then
            MsgBox "Please select a remote directory to PUT to!"
            Exit Sub
        End If
        If nodX.Image = "leaf" Then
            MsgBox "Bitte wähle den Zielordner aus!"
            Exit Sub
        End If
        If File1.FileName = "" Then
            MsgBox "Du musst schon eine Datei auswählen!"
            Exit Sub
        End If
        
       
      szTempString = nodX.Text
        
        szDirRemote = Right(szTempString, Len(szTempString) - Len(txtServer.Text))
        szFileRemote = File1.FileName
        szFileLocal = File1.Path & "\" & File1.FileName
        If (szDirRemote = "") Then szDirRemote = "\"
        rcd szDirRemote
        
        bRet = FtpPutFile(hConnection, szFileLocal, szFileRemote, _
         dwType, 0)
        If bRet = False Then
            ErrorOut Err.LastDllError, "FtpPutFile"
            Exit Sub
        End If
        
        Dim nodChild As Node, nodNextChild As Node
        Set nodChild = nodX.Child
        Do
          If nodChild Is Nothing Then Exit Do
          Set nodNextChild = nodChild.Next
            TreeView1.Nodes.Remove nodChild.Index
            If nodNextChild Is Nothing Then Exit Do
            Set nodChild = nodNextChild
        Loop
        If nodX.Image = "closed" Then
            nodX.Image = "open"
        End If
        FtpEnumDirectory (nodX.Text)
        FillTreeViewControl (nodX.Text)
   End If


End Sub



danke für eure Hilfe!