DecodeTemplate

Definition

Usage

Transfer the template string Asour which is BASE64 formatted into the Variant-typed template Asour used by the control.

The above-mentioned two methods are mainly used for saving database of templates. Variant-typed templates are saved in the manner

of binary-formatted arrays, which are quite difficult for languages such as PB, VB, etc. Method EncodeTemplate can transfer

Variant-typed codes into strings, and method DecodeTemplate can transfer string-typed codes into codes of Variant-typed. Here,

we should pay attention that the template length will be increased after the template variable BASE64 code has been transferred

into the string.

 

Ejemplo

C#

    /// <summary>
    /// Use after connect and Enroll
    /// </summary>
    /// <param name="pFPEngineVersion">Version of ZKfinger</param>
    private object DecodeTemplate_ZkFinger(string pFPEngineVersion = "10")
        {
    string ret = "";
    string sRegTemplate = axZKFPEngX1.GetTemplateAsStringEx(pFPEngineVersion);
    object pTemplateEncode, pTemplateDecode = null;
            pTemplateEncode = axZKFPEngX1.DecodeTemplate1(sRegTemplate);
    // Encode
            axZKFPEngX1.EncodeTemplate(pTemplateEncode, ref ret);
    // Decode
            axZKFPEngX1.DecodeTemplate(ret, ref pTemplateDecode);
    return pTemplateDecode;
        }

VB

        ''' <summary>
''' Use after connect and Enroll
''' </summary>
''' <param name="pFPEngineVersion">Version of ZKfinger</param>
Private Function DecodeTemplate_ZkFinger(Optional pFPEngineVersion As String = "10") As Object
        Dim ret As String = ""
        Dim sRegTemplate As String = axZKFPEngX1.GetTemplateAsStringEx(pFPEngineVersion)
        Dim pTemplateEncode As Object, pTemplateDecode As Object = Nothing
	pTemplateEncode = axZKFPEngX1.DecodeTemplate1(sRegTemplate)
        ' Encode
	axZKFPEngX1.EncodeTemplate(pTemplateEncode, ret)
        ' Decode
	axZKFPEngX1.DecodeTemplate(ret, pTemplateDecode)
        Return pTemplateDecode
End Function