int stdcall YW_KeyAuthorization
(
int ReaderID,
char KeyMode,
int BlockAddr,
unsigned char *Key
);
參數 |
類型 |
方向 |
含義 |
ReaderID |
int |
IN |
所要獲取的設備標示ID,范圍0x0000-0xFFFF,如果未知,則ReaderID=0 |
KeyMode |
char |
IN |
驗證密鑰類別: 0x60->A密鑰 0x61->B密鑰 |
BlockAddr |
int |
IN |
要授權卡片的絕對塊號地址 |
Key |
unsigned char * |
IN |
當前密鑰字節(共6個字節) |
返 回 值:大于0為命令發送成功,小于0為命令發送失敗
int stdcall YW_KeyAuthorization (int ReaderID,char KeyMode,int BlockAddr, unsigned char *Key);
function YW_KeyAuthorization(ReaderID: Integer;KeyMode: Byte;BlockAddr: Integer; Key: PChar): Integer;stdcall;external YOWOREADERDLL;
Public Declare Function YW_KeyAuthorization Lib "YW60x.dll" (ByVal ReaderID As Long, ByVal KeyMode As Byte, ByVal BlockAddr As Long, ByRef Key As Byte) As Long
public int YW_KeyAuthorization(int ReaderID,int KeyMode, int BlockAddr, Pointer Key)
{
int ret;
try
{
JNative fuc = new JNative("YW60x.dll", "YW_KeyAuthorization");
fuc.setRetVal(Type.INT);
fuc.setParameter(0, ReaderID);
fuc.setParameter(1,KeyMode);
fuc.setParameter(2,BlockAddr);
fuc.setParameter(3,Key);
fuc.invoke();
ret = fuc.getRetValAsInt();
}
catch(NativeException e)
{
ret = -1;
}
catch(IllegalAccessException e)
{
ret = -2;
}
return ret;
}
[DllImport("YW60x.dll")]
public static extern int YW_KeyAuthorization(int ReaderID,int KeyMode, int BlockAddr, byte [] Key);
public FUNCTION long YW_KeyAuthorization (long lReaderID , char KeyMode, long BlockAddr , ref char Key[]) library "YW60x.dll"