There is nothing wrong with other problems, mainly in the subroutine for detecting signatures. There is something wrong with the dll command ... not if you don't make it up. In fact, your original code is also ok. As long as you don't use dll, just put the subroutine of dll into the program and run it after compilation.
The main problem is the path of the database.
It turns out that the debugging operation is carried out in the temporary folder of the system. There is no database file in that folder, so it can't be opened naturally, so it will show that opening failed. I modified your dll command a little, and I think it should be enough.
======================================================================
Version 2
. Subroutine signature detection, integer type, public, 1, passing 0. It failed.
. Parameter signature unit, text type
. Parameter authorization method, integer type, 1. A time-limited type that takes effect when the expiration time of the signed file begins. 2. Quantity-limited type, when the number of times the signature file is used starts to work.
Parameters Database path, text type and absolute path of database =. =
Parameters database password, text type, password required to open the database-. -
. Local variable current system date and time, date and time type.
. Signature unit read by local variable, text type.
Read the authorization mode of local variables, integer,,, 1. Time limit 2. Quantity limit.
Time of local variable failure, date-time type
Number of times local variables are used, integer type.
. Data returned by local variables, integer type.
Current system date and time = current time ()
Open (database path,,, database password)
Set the current library (database path)
The first record ()
Signature unit read = read ("signature unit")
. If (signature unit reading = signature unit)' Check the signature unit.
The first record ()
Authorized mode of reading = reading ("authorized mode")
. If (authorization mode = authorization mode read)' detection requires the same authorization mode as the signature file.
. Start judging (authorization mode = 1)
Expiration time = read ("expiration time")
If (rounding (taking time interval (current system date and time, expiration time, days)) < 0)
Information box ("Signature file expired!" , 0, )
Data returned = 0
Otherwise.
Data returned = 1
If it's over
. Judgment (authorization method = 2)
Usage = read ("remaining usage")
. If (usage times < 1)
Information box ("Signature file used: 0!" , 0, )
Data returned = 0
Otherwise.
The first record ()
Usage = read ("remaining usage")
Write ("Remaining Usage Times", Usage Times-1)
Data returned = 1
If it's over
. default
The trial is over
Otherwise.
Information box ("wrong signature file, incorrect authorization method!") ) , 0, )
Data returned = 0
If it's over
Otherwise.
Information box ("The signature unit is wrong, please use the correct signature granting program!" , 0, )
Data returned = 0
If it's over
Return (returned data)
======================================================================