RobotStudio event

Displaying controller Folder and Files in ListView

Hello I am looking for a way to display the controller folder and files in a ListView in my application.  I was looking through the Controller.FileSystem methods and came
across BeginListDirectory but not sure if that is the correct one to use.  Anybody got any suggestions?


  • How can I get more help on BeginListDirectory and examples of using this?
  • Newbe,
    I was also looking for the same thing and I have figured it out with help from Rob Thornton at ABB US.  Thanks Rob.  Below is the code that I figured out from the function that you recommended.

      Public Sub LoadControllerListView(ByRef lvToLoad As ListView, ByVal sFolderToLoad As String)

        Dim sFileType As String = ""
        Dim aFileSystem As Controllers.FileSystemDomain.FileSystem = controller.FileSystem
        Dim anArray As Controllers.FileSystemDomain.ControllerFileSystemInfo()
        Dim info As Controllers.FileSystemDomain.ControllerFileSystemInfo
          controller.FileSystem.RemoteDirectory() = sFolderToLoad
          anArray = controller.FileSystem.GetFilesAndDirectories(".")
          For i As Integer = 0 To anArray.Length - 1
            info = anArray(i)
            If info.Name <> ".." And info.Name <> "." Then
              Dim item As New ListViewItem(info.Name)
            End If
        Catch ex As Exception

        End Try

      End Sub

  • Hey David,
    Thanks for the example code, it works great!  I have already updated my app.