UiPath Documentation
activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

工作流活动

上次更新日期 2026年4月27日

获取凭据

使用提供的资产名称获取指定的凭据资产。如果凭据资产不是全局资产,则必须将其分配给本地机器人才能检索。

定义

命名空间: UiPath.Activities.System.API

程序集: UiPath.System.Activities.Api(在 UiPath.System.Activities.Api.dll 中)

重载

GetCredential(String)使用提供的资产名称获取指定的 Orchestrator 凭据,并返回用户名。
GetCredential(String userName, SecureString Password)使用提供的资产名称获取指定的 Orchestrator 凭据,并返回用户名和密码。

GetCredential(String)

使用提供的资产名称获取指定的 Orchestrator 凭据,并返回用户名。有关凭据资产的更多信息,请参阅关于资产

string GetCredential(
    string assetName,
    string folderPath,
    out SecureString password,
    CacheStrategyEnum cacheStrategy,
    int timeoutMS
)
string GetCredential(
    string assetName,
    string folderPath,
    out SecureString password,
    CacheStrategyEnum cacheStrategy,
    int timeoutMS
)

string assetName :要为其检索用户名的资产的名称。

string folderPath :存储资产的 Orchestrator 文件夹的路径(如果位置与运行流程的文件夹不同)。使用/作为分隔符来表示子文件夹,例如“财务/应付账款”。

out SecureString Password :输出参数。要用于存储密码的变量,您稍后可以通过此输出参数引用该变量。

CacheStrategyEnum “缓存策略” :将检索到的值存储在缓存中的持续时间。默认情况下,所有请求都将转发到 Orchestrator。 ```可用选项为执行“执行”选项会缓存 Orchestrator 资产,并将其用于整个流程执行。

int timeoutMS :最长等待时间(以毫秒为单位),如果超出该时间,方法便会引发错误。默认值为 30000 毫秒(30 秒)。

GetCredential(String, SecureString)

使用提供的资产名称获取指定的 Orchestrator 凭据,并返回用户名和安全密码。有关凭据资产的更多信息,请参阅关于资产

(string, SecureString) GetCredential(
    string assetName,
    string folderPath,
    int timeoutMS,
    CacheStrategyEnum cacheStrategy
)
(string, SecureString) GetCredential(
    string assetName,
    string folderPath,
    int timeoutMS,
    CacheStrategyEnum cacheStrategy
)

string assetName :要为其检索用户名的资产的名称。

string folderPath :存储资产的 Orchestrator 文件夹的路径(如果位置与运行流程的文件夹不同)。使用/作为分隔符来表示子文件夹,例如“财务/应付账款”。

int timeoutMS :最长等待时间(以毫秒为单位),如果超出该时间,方法便会引发错误。默认值为 30000 毫秒(30 秒)。

CacheStrategyEnum “缓存策略” :将检索到的值存储在缓存中的持续时间。默认情况下,所有请求都将转发到 Orchestrator。 ```可用选项为执行“执行”选项会缓存 Orchestrator 资产,并将其用于整个流程执行。

  • 定义
  • 重载
  • GetCredential(String)
  • GetCredential(String, SecureString)

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新