Home Image-Pro Automation (Macros, Apps, Reports)

Search a directory

Image-Pro Plus had a function called IpStSearchDir which allowed you to look if a file existed in a directory. Is there an equivalent in Premier?

Answers

  • Hi David,

    You can use VB.NET function GetFiles for that. Here is the example:

        Public Sub GetListOfTifFiles()
            ' Only get TIF files
            Dim files As String() = System.IO.Directory.GetFiles("c:\", "*.tif")
            Debug.Print(String.Format("The number of TIF files is {0}.", files.Length))
            Dim fn As String
            For Each fn In files
                Debug.Print(fn)
            Next
        End Sub
    

    You can get more info here:
    http://msdn.microsoft.com/en-us/library/wz42302f(v=vs.110).aspx

    Regards,

    Yuri
Sign In or Register to comment.