NurApiTagGetAccessPassword Method

Get Access password of tag

Definition

Namespace: NurApiDotNet
Assembly: NordicID.NurApi.Net (in NordicID.NurApi.Net.dll) Version: 4.0.0
C#
public uint GetAccessPassword(
	uint passwd,
	bool secured
)

Parameters

passwd  UInt32
Current access password
secured  Boolean
Set true if secured

Return Value

UInt32
Access password

Example

A tag's ('aTag') password memory has been locked with password 0xA5A5FEFE.

Here's how to check that the locking was OK by reading the access password back :

C#
bool CheckThisPassword(NurApi.Tag aTag, uint accessPwd)
{
    uint accessPwd = 0xA5A5FEFE;

    try
    {
        // The value needs not to be checked; a successfule access will tell that it is OK.
        aTag.GetAccessPassword(accessPwd, true);
        return true;
    }
    catch { /* More error handling here if necessary. */ }

    return false;
}

See Also