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

开发者活动

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

加密文件

UiPath.Cryptography.Activities.EncryptFile

描述

根据指定的密钥编码和算法使用密钥加密文件。

项目兼容性

Windows - 旧版 | Windows | 跨平台

Windows、跨平台配置

  • File - The file to be encrypted, stored as an IResource variable. Select the Plus docs image menu to switch to the Input Path input.
  • Algorithm - A drop-down menu which enables you to select the encryption algorithm you want to use. The following options are available: AES (Deprecated), AES GCM, DES (Deprecated), RC2 (Non-FIPS) (Deprecated), Rijndael (Non-FIPS) (Deprecated), and TripleDES.
高级选项

选项

  • Key Encoding - The encoding used to interpret the key specified in the Key property. The following options are available: System default, Unicode, Unicode (Big-Endian), Unicode (UTF-32), Unicode (UTF-32 Big-Endian), US-ASCII, Western European (ISO), and Unicode (UTF-8).
  • Output file name and location - The path where you want to save the encrypted file. This field supports only strings and String variables.
    备注:

    Relative folder paths are recommended to account for the different file structure between Windows and Linux machines when executing a project. A relative path follows the format newFolder/newFileName.enc. The activity creates the target folder if it does not already exist.

  • Overwrite - If a file already exists, selecting On overwrites it. If the toggle is set to Off, a new file is created. The default value is Off.
  • “出错时继续”- 指定在活动抛出错误时是否应继续自动化操作。该字段仅支持“布尔值”(TrueFalse)。默认值为 False。因此,如果该字段为空且活动引发错误,系统将停止执行项目。如果该值设为“True”,则无论出现何种错误,系统都将继续执行项目。

根据输出路径以及文件已存在的情况,可能会出现以下结果:

输出文件的名称和位置覆盖输出结果
取消设置关闭A file with the original file name + the suffix "_Encrypted". If the file already exists, an error is thrown.
取消设置启动A file with the original file name + the suffix "_Encrypted". If the file already exists, the file will be overwritten.
集合关闭A file as per user preference. If the file already exists, an error is thrown.
集合启动A file as per user preference. If the file already exists, the file will be overwritten.

输出

  • Encrypted File - Reference to the decrypted file retrieved by the activity for use in other activities.

Windows - 旧版配置

属性面板

常见

  • “出错时继续”- 指定在活动抛出错误时是否应继续自动化操作。该字段仅支持“布尔值”(TrueFalse)。默认值为 False。因此,如果该字段为空且活动引发错误,系统将停止执行项目。如果该值设为“True”,则无论出现何种错误,系统都将继续执行项目。
    备注:

    如果“Try Catch 异常处理”中包含该活动且“出错时继续”属性的值为“True”,则系统在执行项目时不会捕获任何错误。

  • “显示名称”- 活动的显示名称。

输入

  • Algorithm - A drop-down menu which enables you to select the encryption algorithm you want to use. The following options are available: AES (Deprecated), AES GCM, DES (Deprecated), RC2 (Non-FIPS) (Deprecated), Rijndael (Non-FIPS) (Deprecated), and TripleDES.

    备注:

    When using the AES GCM algorithm, the decryption input must be provided in the format of (concatenated bytes): Salt (8bytes) + IV (12 bytes) + encryptedData (variable bytes) + Tag (16 bytes). The activity also uses the following parameters:

    • PBKDF2 迭代计数为 10000
    • 生成的密钥为 256 位(32 字节)

    Note that the 256-bit generated key is not the same as the Key input option.

  • Encrypted Filename - The file name you want to use to save the encrypted file.

  • Input Path - The path to the file that you want to encrypt. This field supports only strings and String variables.

  • Key - The key that you want to use to encrypt the specified file. This field supports only strings and String variables.

  • Key Encoding - The encoding used to interpret the key specified in the Key property. This field supports only Encoding variables.

  • Key Secure String - The secure string used to encrypt the input file.

  • Output file name and location - The path where you want to save the encrypted file. This field supports only strings and String variables.

  • Overwrite - If a file already exists at the path specified in the OutputPath field, selecting this check box overwrites it. If unchecked, a new file is created. By default, this check box is cleared.

其他

  • “私有”- 选中后将不再以“Verbose”级别记录变量和参数的值。
  • 描述
  • 项目兼容性
  • Windows、跨平台配置
  • Windows - 旧版配置

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新