Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# DocumentLicense.getExternalDriveHardwareCode Method

Module: DocumentLicense

## Definition

Retrieves the hardware code of the external drive you run the library on. This function works on Windows only.

Python

    @staticmethod
    get_external_drive_hardware_code(hardware_code_type: LicenseHardwareCodeType, external_drive_path: str=None) -> str

Parameters

> `hardware_code_type` LicenseHardwareCodeType
> in The requested hardware code type. Must be windowsUsb.
> `external_drive_path` str
> in On Windows to activate a license on a USB device, it must contain the path to the requested USB drive (e.g ‘G:').

Returns

> `str`
> The device hardware code.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Dart

    static String getExternalDriveHardwareCode(LicenseHardwareCodeType hardwareCodeType, String? externalDrivePath)

Parameters

> `hardwareCodeType` LicenseHardwareCodeType
> in The requested hardware code type. Must be windowsUsb.
> `externalDrivePath` String
> in On Windows to activate a license on a USB device, it must contain the path to the requested USB drive (e.g ‘G:').

Returns

> `String`
> The device hardware code.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C#

    public static string GetExternalDriveHardwareCode(LicenseHardwareCodeType hardwareCodeType, string externalDrivePath=null)

Parameters

> `hardwareCodeType` LicenseHardwareCodeType
> in The requested hardware code type. Must be windowsUsb.
> `externalDrivePath` string
> in On Windows to activate a license on a USB device, it must contain the path to the requested USB drive (e.g ‘G:').

Returns

> `string`
> The device hardware code.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Java

    public static String getExternalDriveHardwareCode(LicenseHardwareCodeType hardwareCodeType, String externalDrivePath) throws DocumentException

Parameters

> `hardwareCodeType` LicenseHardwareCodeType
> in The requested hardware code type. Must be windowsUsb.
> `externalDrivePath` String
> in On Windows to activate a license on a USB device, it must contain the path to the requested USB drive (e.g ‘G:').

Returns

> `String`
> The device hardware code.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C

    int id3DocumentLicense_GetExternalDriveHardwareCode (
        id3DocumentLicenseHardwareCodeType eHardwareCodeType,
        char * code,
        int * codeSize,
        const char * externalDrivePath)

Parameters

> `eHardwareCodeType` id3DocumentLicenseHardwareCodeType
> in The requested hardware code type. Must be windowsUsb.
> `code` char *
> out The device hardware code.
> `codeSize` int *
> in Size of the ‘code’ buffer. Receives the minimum required buffer size to hold the ‘code’ string if the given one is too small (including the terminating NULL character), otherwise receives the number of characters in ‘code’ (excluding terminating NULL character).
> `externalDrivePath` const char *
> in On Windows to activate a license on a USB device, it must contain the path to the requested USB drive (e.g ‘G:').

Returns

> `int`
> An error code.
> See id3DocumentError file for the list of possible error codes.