Results 1 to 8 of 8

Thread: [RESOLVED] [2008] Find search file in directorim

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2008
    Location
    Macedonia
    Posts
    188

    Resolved [RESOLVED] [2008] Find search file in directorim

    I need simple code for searching files in text box to enter the name of file and in listbox to show results of searching.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2008] Find search file in directorim


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2008
    Location
    Macedonia
    Posts
    188

    Re: [2008] Find search file in directorim

    Code:
    Imports System
    Imports System.IO
    Public Class GetFilesTest
        Public Shared Sub Main()
            ' Make a reference to a directory.
            Dim di As New DirectoryInfo("c:\")
            ' Get a reference to each file in that directory.
            Dim fiArr As FileInfo() = di.GetFiles()
            ' Display the names of the files.
            Dim fri As FileInfo
            For Each fri In fiArr
                Console.WriteLine(fri.Name)
            Next fri
        End Sub 'Main
    End Class 'GetFilesTest
    But i dont want to take i file i want some file with some name morandi - angels and to show only that. ??

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2008] Find search file in directorim

    I don't understand you. What is "morandi - angels"?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2008
    Location
    Macedonia
    Posts
    188

    Re: [2008] Find search file in directorim

    The name of the song that i want to find in the directorium "morandi - angles.mp3" this is exsample

  6. #6
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Find search file in directorim

    is this what you mean?

    vb Code:
    1. Dim files() As String = IO.Directory.GetFiles("c:\", "morandi - angels.mp3", IO.SearchOption.AllDirectories)

    the 2nd parameter can contain wildcard characters (i.e. '*')

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jun 2008
    Location
    Macedonia
    Posts
    188

    Re: [2008] Find search file in directorim

    Somthing like that is possible without exstension please tell some using of this command.
    Dim files() As String = IO.Directory.GetFiles("c:\", "morandi - angels.mp3", IO.SearchOption.AllDirectories)

  8. #8
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Find search file in directorim

    Dim files() As String = IO.Directory.GetFiles("c:\", "morandi - angels.*", IO.SearchOption.AllDirectories)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width