卡密钥访问控制 [英] Card Key Access Control
问题描述
Hello Experts,
有没有人编写程序脚本,允许VFP应用程序将指令写入卡密钥编码器,然后用于打开电子门锁?密钥卡具有用C ++编写的SDK, Delphi
和VB6。但是,我寻找相同任务的VFP脚本。
谢谢。
Andrew
推荐答案
C ++提示中心组件是一个可以与DECLARE DLL一起使用的DLL。请注意带有函数声明的头文件(.h)。
C++ hints on the central component being a DLL you can use with DECLARE DLL. Look out for a header file (.h) with function declarations.
这是一个示例rom zlib.dll以及它如何转换为VFP DECLARE DLL:
Here's a sample rom zlib.dll and how it tranlsates to a VFP DECLARE DLL:
下载http://www.winimage.com/zLibDll/zlib123.zip(来源,我们需要zlib.h)和http://www.winimage.com/zLibDll/zlib123dll.zip(DLL)
Download http://www.winimage.com/zLibDll/zlib123.zip (sources, we need zlib.h) and http://www.winimage.com/zLibDll/zlib123dll.zip (DLL)
ERASE (Addbs(Getenv("TEMP"))+"vfp9_level*.gz")
Cd C:\zlib123dll && adjust where you unzipped zlib zlibwapi.dll (within dll32 folder)
* ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
* means following DECLARE
Declare Integer gzopen In zlibwapi.Dll String @ Path, String @ Mode
* note: The mode parameter is as in fopen ("rb" or "wb") but can also include a compression level ("wb9")
* ZEXTERN int ZEXPORT gzclose OF((gzFile file));
* means following DECLARE
Declare Integer gzclose In zlibwapi.Dll Integer FileHandle
* ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
* means following DECLARE
Declare Integer gzread In zlibwapi.Dll Integer FileHandle, String @ Buffer, Integer BufferLength
* ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
* means following DECLARE
Declare Integer gzwrite In zlibwapi.Dll Integer FileHandle, String @ Buffer, Integer BufferLength
Local lcOriginal, lnLevel, lcLevel, lcFile, lnFilehandle
lcOriginal = FILETOSTR(ADDBS(HOME())+"vfp9.exe")
? "Original length:", Len(lcOriginal)
For lnLevel=1 To 9
lcLevel = Alltrim(Str(lnLevel))
lcFile = Addbs(Getenv("TEMP"))+"vfp9_level"+lcLevel+".exe.gz"
lnFilehandle = gzopen(lcFile,"wb"+lcLevel)
gzwrite(lnFilehandle, @lcOriginal, Len(lcOriginal))
gzclose(lnFilehandle)
? "Compressed length for Level "+lcLevel+":", Len(Filetostr(lcFile))
Endfor
如果您不了解C / C ++声明和类型以及它们如何翻译,我知道翻译这些声明是一个障碍。最重要的一个C *指针转换为VFP中的STRING @指针,int(和无符号)指向INTEGER。
I know to translate these declarations is a hurdle, if you don't know C/C++ declarations and types and how they translate. Most important a C *pointer translates to a STRING @ pointer in VFP, int (and unsigned) to INTEGER.
所以告诉你,你正在尝试使用什么,或者没有人有机会拾取想法为VFP非C开发人员启用此功能。请在您的问题中提供信息以获得更好的答案。
So tell, what you're trying to use, or there is no chance anyone might pickup the idea to enable this to VFP non C developers. Please provide informations in your question to get better answers.
再见,奥拉夫。
这篇关于卡密钥访问控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!