Skip To Content

Portal.Names (.NET)

Portal.Names 方法将以字符串形式返回管理门户对话框中的门户名称集合。 可以在 ArcGIS for AutoCAD 中通过添加数据窗口管理门户。

注:

首先通过默认门户名称 "ArcGIS Online""ArcGIS Enterprise" 来访问门户名称。 登录后,门户名称可能是您的管理员设置的组织名称。

声明

public IEnumerable<string> Esri.ArcGISForAutoCAD.Portal.Names()

参数

此方法没有任何参数。

返回

类型描述

IEnumerable<string>

字符串形式的 ArcGIS 门户名称的集合。

错误条件备注

如果当前会话中没有任何门户,则此方法可能会抛出异常或者返回 null

示例

打印当前已添加至 ArcGIS for AutoCAD 的门户名称。

// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;

// Get the portal names
var portalNames = Esri.ArcGISForAutoCAD.Portal.Names();

// Print the portal names
foreach (var name in portalNames)
{
  doc.Editor.WriteMessage("\n" + name);
}

/* Example output 
ArcGIS Online
CAD Team Enterprise 11.3
*/

另请参阅

esri_portal_names - 此 AutoLISP 函数可从托管门户获取一个字符串形式的门户名称列表。