raptorpb1
asked on
Certain files in listbox
Hi,
Im working on a file sharing program.
I want it so when the person views the host's files, all they see are .txt and .log
here is the part listing it
Private Sub fillDir(Incoming As String)
Dim i As Integer
Dim strCut As String
cutString strCut, Incoming
i = Val(strCut)
If i > 1 Then
For i = 1 To i - 1
cutString strCut, Incoming
lstFiles.AddItem strCut
Next i
End If
lstFiles.AddItem Incoming
lstFiles.ListIndex = 0
End Sub
Im working on a file sharing program.
I want it so when the person views the host's files, all they see are .txt and .log
here is the part listing it
Private Sub fillDir(Incoming As String)
Dim i As Integer
Dim strCut As String
cutString strCut, Incoming
i = Val(strCut)
If i > 1 Then
For i = 1 To i - 1
cutString strCut, Incoming
lstFiles.AddItem strCut
Next i
End If
lstFiles.AddItem Incoming
lstFiles.ListIndex = 0
End Sub
ASKER
Doesn't work. I still see all the files
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, i read it wrong
did think you didn't want .txt and .log.
did think you didn't want .txt and .log.
ASKER
Thank You
p_sie, since I used your answer, teke your points here:
http://oldlook.experts-exchange.com/questions/20810010/Points-for-p-sie.html
http://oldlook.experts-exchange.com/questions/20810010/Points-for-p-sie.html
cutString strCut, Incoming
IF Right(StrCut,4) <> ".txt" AND Right(StrCut,4) <> ".log" Then
lstFiles.AddItem strCut
End If
Next i