Link to home
Start Free TrialLog in
Avatar of raptorpb1
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

Avatar of p_sie
p_sie
Flag of Netherlands image

For i = 1 To i - 1
         cutString strCut, Incoming
         IF Right(StrCut,4) <> ".txt" AND Right(StrCut,4) <> ".log" Then
                      lstFiles.AddItem strCut
         End If
Next i
Avatar of raptorpb1
raptorpb1

ASKER

Doesn't work. I still see all the files
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, i read it wrong
did think you didn't want .txt and .log.
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