TComponent ----+ | TBasicCard
Unit:
ZCDCI1
(ZCDCI1.pas)
Constructors:
constructor Create(AOwner: TComponent); override;Properties:
property ApplicationID: String read GetApplicationID;
property ATR: ZCCRIATR read fATR;
property CardHandle: ZCBCICARD read fCard;
property DefaultReader: String read GetDefaultReader write SetDefaultReader;
property Error: ZCCRIRET read fError;
property FileError: Byte read fFileError;
property IsConnected: Boolean read fConnected;
property IsOpen: Boolean read fIsOpen;
property OnCardInserted: TNotifyEvent read fOnCardInserted write fOnCardInserted;
property OnCardRemoved: TNotifyEvent read fOnCardRemoved write fOnCardRemoved;
property OnReaderBusy: TNotifyEvent read fOnReaderBusy write fOnReaderBusy;
property ReaderCount: Integer read GetReaderCount;
property ReaderHandle: ZCCRIREADER read fReader;
property Readers[Num: Integer]: String read GetReaderName;
property SW1SW2: Word read fSW1SW2;Methods:
function CardInReader: Boolean;
function ChDir(Path: String): Boolean;
function CloseAllFiles: Boolean;
function CloseFile(FileNum: Byte): Boolean;
function CloseReader: Boolean;
function Connect: Boolean; virtual;
function CurDir(var Path: String): Boolean;
destructor Destroy; override;
function DirCount(FileSpec: String; var Count: Word): Boolean;
function DirFile(FileSpec: String; Num: Word; var FileName: String): Boolean;
function Disconnect: Boolean; virtual;
function Echo(var Chars: String; Incr: Byte): Boolean;
function EndEncryption: Boolean;
function EraseFile(Path: String): Boolean;
function FileGet(FileNum: Byte; var Data; Count: Byte): Boolean;
function FileLength(FileNum: Byte; var Length: DWORD): Boolean;
function FilePut(FileNum: Byte; const Data; Count: Byte): Boolean;
function FileRead(FileNum: Byte; var Data; Count: Byte): Boolean;
function FileWrite(FileNum: Byte; const Data; Count: Byte): Boolean;
function GetAttr(Path: String; var Attrib: Word): Boolean;
function GetFilePos(FileNum: Byte; var FilePos: DWORD): Boolean;
function GetLockInfo(Path: String; var LockInfo: ZCBCILOCKINFO): Boolean;
function MkDir(Path: String): Boolean;
function OpenFile(Path: String; Mode: Byte; RecordLen: Word; var FileNum: WORD): Boolean;
function OpenReader(Reader: String): Boolean;
function QueryEOF(FileNum: Byte; var EOF: Boolean): Boolean;
function Reconnect: Boolean; virtual;
function Rename(OldPath, NewPath: String): Boolean;
function RmDir(Path: String): Boolean;
function SelectReaderDialog: Boolean;
function SetFileLock(Path: String; LockType: Byte; Lock: Boolean; KeyCount, Key1, Key2: Byte): Boolean;
function SetFilePos(FileNum: Byte; FilePos: DWORD): Boolean;
function SetKey(KeyNum: Byte; Key: String): Boolean;
function SetPoly(PolyA, PolyB: DWORD): Boolean;
function StartEncryption(Algo, Key: Byte): Boolean;
function Transaction(CLA, INS: Byte; PData: PZCBCIPARM; DataCount: Byte): Boolean;
function Transaction2(CLA, INS, P1, P2, Lc, Le: Byte; PData: PZCBCIPARM; DataCount: Byte): Boolean;
constructor Create(AOwner: TComponent); override;
property ApplicationID: String read GetApplicationID;
property ATR: ZCCRIATR read fATR;
property CardHandle: ZCBCICARD read fCard;
property DefaultReader: String read GetDefaultReader write SetDefaultReader;
property Error: ZCCRIRET read fError;
property FileError: Byte read fFileError;
property IsConnected: Boolean read fConnected;
property IsOpen: Boolean read fIsOpen;
property OnCardInserted: TNotifyEvent read fOnCardInserted write fOnCardInserted;
property OnCardRemoved: TNotifyEvent read fOnCardRemoved write fOnCardRemoved;
property OnReaderBusy: TNotifyEvent read fOnReaderBusy write fOnReaderBusy;
property ReaderCount: Integer read GetReaderCount;
property ReaderHandle: ZCCRIREADER read fReader;
property Readers[Num: Integer]: String read GetReaderName;
property SW1SW2: Word read fSW1SW2;
function CardInReader: Boolean;
function ChDir(Path: String): Boolean;
Path : New directory
function CloseAllFiles: Boolean;
function CloseFile(FileNum: Byte): Boolean;
function CloseReader: Boolean;
function Connect: Boolean; virtual;
function CurDir(var Path: String): Boolean;
Path : Will contain current directory
destructor Destroy; override;
function DirCount(FileSpec: String; var Count: Word): Boolean;
FileSpec : File specificationCount : Will contain number of files and directories
function DirFile(FileSpec: String; Num: Word; var FileName: String): Boolean;
FileSpec : File specificationNum : Number of file (starting with 1)FileName : Returns with name of matched file
function Disconnect: Boolean; virtual;
function Echo(var Chars: String; Incr: Byte): Boolean;
Chars : The String to pass to the function and the resultIncr : Increment all chars by this value
function EndEncryption: Boolean;
function EraseFile(Path: String): Boolean;
Path : File name
function FileGet(FileNum: Byte; var Data; Count: Byte): Boolean;
Data : A buffer for the dataCount : Number of bytes to read
function FileLength(FileNum: Byte; var Length: DWORD): Boolean;
Length : Will contain the file length
function FilePut(FileNum: Byte; const Data; Count: Byte): Boolean;
Data : A buffer for the dataCount : Number of bytes to write
function FileRead(FileNum: Byte; var Data; Count: Byte): Boolean;
Data : A buffer for the dataCount : Number of bytes to read
function FileWrite(FileNum: Byte; const Data; Count: Byte): Boolean;
Data : A buffer for the dataCount : Number of bytes to write
function GetAttr(Path: String; var Attrib: Word): Boolean;
Path : File nameAttrib : If successful will return attribute
function GetFilePos(FileNum: Byte; var FilePos: DWORD): Boolean;
FilePos : Returns current position (starting with 1)
function GetLockInfo(Path: String; var LockInfo: ZCBCILOCKINFO): Boolean;
Path : File nameLockInfo : ZCBCILOCKINFO structure that will contain lock information
function MkDir(Path: String): Boolean;
Path : New directory
function OpenFile(Path: String; Mode: Byte; RecordLen: Word; var FileNum: WORD): Boolean;
Path : The file name (without @:)Mode : File modeRecordLen : Record/block sizeFileNum : Will contains the file number when returning successfully
function OpenReader(Reader: String): Boolean;
Reader : The name of the reader or an empty string to open the default reader
function QueryEOF(FileNum: Byte; var EOF: Boolean): Boolean;
EOF : Will contain true if EOF reached when returning successfully
function Reconnect: Boolean; virtual;
function Rename(OldPath, NewPath: String): Boolean;
OldPath : Current filenameNewPath : New filename
function RmDir(Path: String): Boolean;
Path : Directory to remove
function SelectReaderDialog: Boolean;
function SetFileLock(Path: String; LockType: Byte; Lock: Boolean; KeyCount, Key1, Key2: Byte): Boolean;
Path : File nameLockType : Lock type (ZCBCI_LOCK_...)Lock : True to lock file, False to unlock itKeyCount : Number of access keys (0..2)Key1 : Number of first key (if appropiate)Key2 : Number of second key (if appropiate)
function SetFilePos(FileNum: Byte; FilePos: DWORD): Boolean;
FilePos : New position (starting with 1)
function SetKey(KeyNum: Byte; Key: String): Boolean;
KeyNum : Key numberKey : The key itself (8 or 16 bytes long)
function SetPoly(PolyA, PolyB: DWORD): Boolean;
PolyA : First polynomPolyB : Second polynom
function StartEncryption(Algo, Key: Byte): Boolean;
Algo : The algorithm or 0 for auto-selectionKey : The key number
function Transaction(CLA, INS: Byte; PData: PZCBCIPARM; DataCount: Byte): Boolean;
CLA : Command class byteINS : Command instruction bytePData : A pointer to an array of ZBCIPARMDataCount : Numer of parameters to pass
function Transaction2(CLA, INS, P1, P2, Lc, Le: Byte; PData: PZCBCIPARM; DataCount: Byte): Boolean;
CLA : Command class byteINS : Command instruction byteP1 : P1 byteP2 : P2 byteLc : Lc or ZBCI_DEFAULT_LCLe : Le, ZCBCI_DISABLE_LE or ZCBCI_DEFAULT_LEPData : A pointer to an array of ZBCIPARMDataCount : Numer of parameters to pass