ArcGIS Pro 3.5 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 static IReadOnlyList<Tuple<string,string>> GetRecentProjectsEx()
    Public Shared Function GetRecentProjectsEx() As IReadOnlyList(Of Tuple(Of String,String))

    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 projectPath;
      string projectName;
      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, Windows 10

    ArcGIS Pro version: 3.5 or higher.
    See Also