ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / Project Class / GetRecentProjectsEx Method
Example

In This Topic
    GetRecentProjectsEx Method
    In This Topic
    Retrieves the list of recently opened projects
    Syntax
    Public Shared Function GetRecentProjectsEx() As IReadOnlyList(Of Tuple(Of String,String))
    public static IReadOnlyList<Tuple<string,string>> GetRecentProjectsEx()

    Return Value

    A list of Tuple instances containing two strings. The first string is the full path to the .aprx, and the second string is the url for portal projects
    Example
    Retrieve the list of recently opened projects
    {
      IReadOnlyList<Tuple<string, string>> result = [];
      //A list of Tuple instances containing two strings.
      //The first string: full path to the .aprx. In case of Portal projects, 
      //this is the cached location of the project on the local machine.
      //Second string:  url for portal projects
      result = Project.GetRecentProjectsEx();
      foreach (var project in result)
      {
        string projectUrl;
        if (!string.IsNullOrEmpty(project.Item2))
        {
          //this is a portal project
          //Url
          projectUrl = project.Item2;
          //local cached location of the portal project
          projectPath = project.Item1;
        }
        else
        {
          //this is a local project
          //path to local project
          projectPath = project.Item1;
        }
        projectName = new FileInfo(project.Item1).Name;
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.5 or higher.
    See Also