W
weilai2570019
Unregistered / Unconfirmed
GUEST, unregistred user!
library ProjDeCode;uses SysUtils, System, Classes; const XorKey:array[0..7] of Byte=($B2,$09,$AA,$55,$93,$6D,$84,$47);function EncStrCode(decode:string):string;stdcall;var strdate:string; strdecode:string; function Dec(Str:String):String; var i,j:Integer; begin Result:=''; j:=0; for i:=1 to Length(Str) div 2 do begin Result:=Result+Char(StrToInt('$'+Copy(Str,i*2-1,2)) xor XorKey[j]); j:=(j+1) mod 8; end; end; function GetDate(temp:string):string; var year,month,day:string; begin result:=''; year :=copy(temp,1,4); month :=copy(temp,6,2); day :=copy(temp,9,2); result:=year+month+day; end;begin if decode='' then begin result:=''; exit; end else begin strdecode:=dec(decode); end; strdate:=copy(strdecode,1,pos('$',strdecode)-1); //result:=2009-10-12; if length(strdate)=10 then begin result:=GetDate(strdate); end else result:=''; end;exports EncStrCode;beginend.vb6中调用这个dll文件Private Declare Function EncStrcode Lib "C:/WINDOWS/system32/ProjDeCode.dll" Private Sub DLLogin() On Error GoTo err Userid = Trim(txtID) UserPassword = txtPassword If Check_Password(Userid, UserPassword) = False Then MsgBox "密码错误!", vbCritical, "登录检查" txtPassword = "" txtPassword.SetFocus Exit Sub End If Dim strdecade As String Dim strdate As String Dim strjmdate As String strdecade = txtdecade.Text strjmdate = EncStrcode(strdecade) ===[][] strdate = Format("yyyymmdd", Now()) If strdate < strjmdate Then Set_Right Unload Me MDIFormmain1.Show DoEvents Else MsgBox "对不起,软件已经过期请重新注册!!!" End Iferr: MsgBox err.NumberEnd Sub中断走了一下 走到 ===[][]这里时直接蹦到err:这里这是那里出现了问题呢是delphi7写的dll 文件有问题还是vb6调用这个dll文件时调用出错了呢在c#中调用时怎么还说没有无法在 DLL“ProjDeCode.dll”中找到名为“EncStrcode”的入口点。那么这个delphi的dll文件该如何去写这个入口函数呢望各位大哥们给与帮助亚