# How to call CreateLicenseKeyEx2 from ASP?

If you need to call CreateLicenseKeyEx2 (Ex3, Ex4, Ex5) from ASP, note that the LicenseType data type does not work as expected in ASP.

For example, the following code will NOT work:

*key = license.CreateLicenseKeyEx2(expDate, 2, 1, UserDefined, "MyComputer")*

Instead, you will need to use the hexadecimal value of the LicenseType argument. The possible values of the LicenseType are:

Generic = 0x47\
Evaluation = 0x45\
Activation = 0x41\
ComputerName = 0x43\
UserDefined = 0x55

For example, to generate a UserDefined license key, the code would then look like:

*key = license.CreateLicenseKeyEx2(expDate, 2, 1, \&H55, "MyComputer")*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.soraco.co/docs/how-to/how-to-call-createlicensekeyex2-from-asp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
