Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (1)

Powered by Vanilla. Made with Bootstrap.
VB.Net File manager help
  • I'm bored. Might as well post my questions to see if anyone can asnwer it. I have been struggling with it for days.
    All right, I'm working on a file manager application in VB.Net.
    I have a variable, hmm... let say "MyDirList".

    It contains information like:


    Data.rtf
    Folder/Example.txt
    Images/2010 Trip/IMG_2010_01.jpg
    Images/2010 Trip/IMG_2010_02.jpg
    Images/2010 Trip/IMG_2010_03.jpg
    Documents/Schoolwork/Science.doc
    Documents/Schoolwork/Unused/Maths.doc


    This is my failed codes:


    Private Sub FolderClickSub(ByVal keyname As String)

    For Each fileitem As String In MyDirList
    If fileitem.FileName.Contains(keyname) Then
    If fileitem.FileName.EndsWith(keyname) Then
    Return
    End If
    End If
    Next

    ListView1.Items.Clear()



    For Each fileitem In MyDirList
    If fileitem.FileName.Contains(keyname) Then

    If Not oldname = keyname Then
    RootPath += keyname + \"/\"
    oldname = keyname
    End If


    Dim newfoldername As String = fileitem.FileName

    If RootPath <> \"\" Then
    newfoldername = SubStringRemove(newfoldername, RootPath)
    End If


    Dim therest As String = \"\"

    If newfoldername.Contains(\"/\") Then
    therest = newfoldername.Substring(newfoldername.IndexOf(\"/\"))

    newfoldername = SubStringRemove(newfoldername, therest)
    End If

    If ListView1.FindItemWithText(newfoldername) Is Nothing Then
    ListView1.Items.Add(newfoldername)
    End If
    End If
    Next
    End Sub


    I know it's a mess, but any help would be very much appreciated!