寫的一手騙流量的好帖,你這這些只能偏偏新手;給你一段觸摸屏的加密代碼你看看,看看有沒BUG:
各種觸摸屏的腳本語言格式可能不是很一樣,我這個是Kinco的,把頭文件和部分關鍵字換一下可以上維綸和昆侖;
#include "macrotypedef.h"
#include "math.h"
/*
Read,Write Local address function:
int ReadLocal( const char *type, int addr, int nRegs, void *buf, int flag );
int WriteLocal( const char *type, int addr, int nRegs, void *buf , int flag );
Parameter: type is the string of "LW","LB" etc;
return value : 1 ,Operation success
eg: read the value of local lw200 and write it to the lw202,with the codetype BIN,
The code is :
short buf[2] = {0};
ReadLocal("LW", 200, 2, (void*)buf, 0);
WriteLocal("LW", 202, 2, (void*)buf, 0);
*/
int MacroEntry()
{
short Date[3]={0};
short Lic[8]={0};
short Cd[16]={0};
short Subb[6]={0};
short i,j;
short YTen,YGe,MTen,MGe,DTen,DGe,Y,M,D;
//short Year,Month,Dat;
ReadLocal("LW",10003,3,(void*)Date,0); //獲取現在日期
int temp=Date[2]*10000+Date[1]*100+Date[0];
CuDG=temp; //當前日期組合
ReadLocal("RW",200,8,(void*)Lic,0); //獲得8個字的授權號
for( i=0,j=0;i<16;i++)
{
if(i%2==0)
Cd=Lic[j] & 0xff;
else
{
}
if(!(Cd>='A' && Cd<= 'Z' ) )
{
Fail=1;
return 0;
}
}
WriteLocal("LW", 20, 16, (void*)Cd, 0); //將拆解后的字符放到LW20-35中
if(Date[1]%2==0) //假如是偶數月
{
YTen=Cd[2]-'H';
YGe=Cd[4]-'E';
MTen=Cd[6]-'I';
MGe=Cd[8]-'J';
DTen=Cd[10]-'K';
DGe=Cd[12]-'F';
}
else
{
YTen=Cd[1]-'F';
YGe=Cd[5]-'E';
MTen=Cd[9]-'M';
MGe=Cd[11]-'H';
DTen=Cd[13]-'U';
DGe=Cd[15]-'M';
}
Subb[0]=YTen;
Subb[1]=YGe;
Subb[2]=MTen;
Subb[3]=MGe;
Subb[4]=DTen;
Subb[5]=DGe;
WriteLocal("LW", 40, 6, (void*)Subb, 0);
Y=YTen*10+YGe;
M=MTen*10+MGe;
D=DTen*10+DGe;
Rq=20000000+Y*10000+M*100+D;
Fail=0;
if(Y>30 || Y<16 || M>12 || M <1 || D>31 || D<1 || Rq<=CuDG)
{
Fail=1;
}
else
{
Fail=0;
if((2000+Y-Date[2])>=2)
KGH=1;
}
return 0;
}