2024年4月2日发(作者:)

如何用VFP制作带二维码的证件

四川省自贡市沿滩中学校 唐崇明

一、下载QRMaker1.3,并解压,将、、、

4个文件复制到C:windowssystem32文件夹下,并在

C:windowssystem32文件下运行Regsvr32 进行控件注册。(windows xp

系统)

二、启动VFP,创建新表单

1、添加到控件工具栏

Tools->Option->Controls->ActiveX

controls->Add->c:->OK->复选QRmaker

Control->OK

2、如下图切换到ActiveX control,

3、拖到表单中,调整位置和大小等

……

VFP实例:

*生成二维码按钮代码

use E:xjgldatabasetablesxsjbqk

set filt to pr=1

go top

pdate0=dtoc(date())+time()

do whil not eof()

if txs=0

ata=bh+subs(xm,1,6)+' '+xb+' '+' 通校生 办证时

间:'+pdate0 &&二维码内容

repl pdate with pdate0

endif

if txs=2

ata=bh+subs(xm,1,6)+' '+xb+' '+' 住校生 办证时

间:'+pdate0 &&二维码内容

repl pdate with pdate0

endif

h

QrMetaFile(1,'e:xjglqr'+bh+'.bmp',2) &&生成

BMP图像文件到E:xjglqr,文件名为 编号(bh).bmp

skip

enddo

三、创建报表,将生成的图片文件用代码的方法添加上去。