locked
Get the file name RRS feed

  • Question

  • Hi
    I try to use this:
            Dim theFolders() As String = Directory.GetDirectories("\\main\musik\abba")
            Try
                For Each file As String In theFolders
                    ListBox1.Items.Add(Path.GetFileName(file))
                Next
            Catch
            End Try

    But what i get is the name on a folder, not the files ?
    and if i can the i want this name to become a link, i don't know if i can this in a listbox ?

    Regards
    alvin

    ALK
    Saturday, October 17, 2009 12:09 PM

Answers

  • I have solve the problem
    ALK
    • Marked as answer by Alvin Kuiper Saturday, October 17, 2009 1:30 PM
    Saturday, October 17, 2009 1:30 PM

All replies

  • Sorry i found the error now i have this:
     Dim theFiles() As String = Directory.GetFiles("\\main\musik\abba\")
            Try
                For Each file As String In theFiles
                    navn = Path.GetFileName(file)
                    ListBox1.Items.Add(navn)
                Next
            Catch
            End Try
    And its working, but i want this name to become a link, maybe not in a listbox
    it is not important
    Regards
    alvin

    ALK
    Saturday, October 17, 2009 12:30 PM
  • I have solve the problem
    ALK
    • Marked as answer by Alvin Kuiper Saturday, October 17, 2009 1:30 PM
    Saturday, October 17, 2009 1:30 PM