Use VB database to write software trials

xiaoxiao2021-03-06  40

It is now a network era. I believe that there are many Networms must be like me. They often travel in the network, often greedy some small cheap, Down some free and practical good stuff, enjoy the network to bring us Free snacks. However, there are some software, saying that it is free. In fact, there are their trials, that is, give you a fixed period free of charge. Once you exceed a certain period, if you resolutely refuse to pay for the fee, huh, The software can't start. Undoubtedly, this is the software sales

A promotional technique for the business. The general people can only look at it, and some people who write small smart will try to modify the system's date or registry, try to shorten the time used. Oh, I like me, who knows the sky, the software developers know that you have this trick, when you have modified the date, the software can usually detect, inform you that you can't modify the system date, otherwise you will not use it. If you are famous, Dreamwaver, some I am smart, I have you had a thumbs up, saying: "High, really high!" So once the software is reached, good Dongdong has to give up, or re-re- Down is down. (Sometimes Down is not available) I know this, don't you come to a "trial period" to get the process of our own development

Preface? Also let others tighten us? What is it too difficult? It is too difficult to do, I, huh, huh, have been closed for a few days, and finally research successfully does not modify the registry, use VB database, write software Method of use period.

Ok, don't sell Guan Zi, start my experience, but first, let me talk about my ideas:

A: The features you should:

1) Given a trial period, it will determine how the software has been used for a few days when the system is started, and the number of times available and started.

2) When the system date is modified into the date of the past, the system can automatically discriminate, prohibiting the date of modification, and is not normal start.

3) When the trial period is time, display information is not started. B: Simple ideas

1) Establish a database file that records system information when the system is running, in a hidden place (such as: c: / windows / system), such as Date.mdb, using a table Date, there are three fields First_Time, Last_Time, and Times. Where first_time is the date at which the system is started, that is, the first day of the trial period .last_time is the time that the system is started, and Times is the number of times the system starts.

2) The system will detect the current date with Last_Time. If the current date (such as 00/09/30) is older than the last_time, the date of the system is pushed, showing Information is not started. Conversely, transfer to the third step.

3) Remove the first_time in the database, make subtracting operations with the current date, see if the number of days is within the time limit. If, turn into the fourth step, otherwise the information is displayed, the system is not started.

4) Modify the Last_Time field of the database as the current date, the display system has been used, and the system is started.

Ok, Luo Luo said a big general, I think everyone must understand, how, I said it is not difficult, do not need to modify the system's registry. As long as everyone puts Date.mdb hits, not I was found to be bigger. And you can add a password to this database, then change the first_time, the field name of the field, even if there is a master discovering the database, cracking the password, he doesn't know these three fields Meaning and this database is the file belt with the software, huh, don't say it, or look at my source code:

In your project, please launch the program with the Sub Main (). (What, how to set, huh, "Project" ==> "Engineering Properties" ==> "Start Form")

Sub main ()

ON Error Goto Error

'System detection has a Date.mdb file, if not, the system is started for the first time, then established

IF Dir ("C: /Windows/system/date.mdb") = "" ""

'Notice at the beginning, you have to determine your project to reference Microsoft Dao 2.5 / 3.5 Compatibility Library in "Project" ==> Reference.

DIM WS AS Workspace

DIM DB AS DATABASE

DIM TD AS TABLEDEF

Dim Fld As Field

DIM IDX AS INDEX

DIM RD As Recordset

SET WS = DBENGINE.WORKSPACES (0)

Set db = ws.createdDatabase ("c: /windows/system/date.mdb", dblangGenel)

DB.Connect = "; pwd = andy"

Set td = db.createtablededef ("date")

Td.attributes = 0

TD.CONNECT = ""

Td.SourceTableName = ""

Td.validationRule = "" "

Td.validationText = "" "

'Field First_Time

Set fld = td.createfield ("first_time", 8, 8)

Fld.attributes = 1

Fld.defaultValue = ""

Fld.ordinalPosition = 0

Fld.Required = false

FLD.VALIDATIONRULE = "" "

Fld.validationText = "" "

Td.fields.Append FLD

'Field Last_Time

Set fld = td.createfield ("Last_time", 8, 8)

Fld.attributes = 1

Fld.defaultValue = ""

Fld.ordinalPosition = 1

Fld.Required = false

FLD.VALIDATIONRULE = "" "

Fld.validationText = "" "

Td.fields.Append FLD

'Field Times

Set fld = td.createfield ("Times", 3, 2)

Fld.attributes = 1

Fld.defaultValue = ""

Fld.ordinalPosition = 2

Fld.Required = false

FLD.VALIDATIONRULE = "" "

Fld.validationText = "" "

Td.fields.Append FLD

Db.tabledefs.append td

Db.close

SET DB = WS.Opendatabase ("c: /windows/system/date.mdb")

Set rd = db.openRecordset ("Date")

With Rd

.Addnew

.Fields ("first_time") = DATE

.Fields ("Last_Time") = DATE

.Fields ("Times") = 1

.Update

End with

Db.close

"This is the first time you start this system! Your trial period is 30 days, today is the first day. Thank you!", 48, "Tianhua Computer Creative Studio"

'Effect is shown in Figure 1 (see Annex 1)

Mainform.show 'Start your main form

The Else 'system has a Date.mdb file, it is not the first time, no need to build a database file .dim WS2 AS Workspace

DIM DB2 AS DATABASE

DIM RD2 As Recordset

SET WS2 = Workspaces (0)

SET DB2 = WS2.Opend DBASE ("c: /windows/system/date.mdb", PWD = "SpringLover")

SET RD2 = DB2.OpenRecordset ("Date")

'Start detection whether the user has modified the system date

Rd2.movefirst

If rd2.fields ("last_time"> Date Then

"Sorry, you cannot modify the system dates during the trial period of this software, otherwise you will cancel the right trial rights. If you want to continue using this software, please restore the system date. Thank you for cooperation!", 48, "Tianhua Computer Creative Studio"

'Effect is shown in Figure 3 (see Annex 3)

End

END IF

'Start detection

If Date - rd2.fields ("first_time")> = 30 Then 'set the trial period of 30 days

MsgBox "You have started this system" & rd2.fields ("Times") & "times, and it has reached a trial period of 30 days, if you want to continue using this software, please go to the company to register and purchase genuine software ! ", 48," Tianhua Computer Creative Studio "

'Effect is shown in Figure 4 (see Annex 4)

End

Else

'Is still in the trial period

Num% = rd2.fields ("Times")

Rd2.edit

Rd2.fields ("Last_Time") = DATE

Rd2.fields ("Times") = NUM ​​ 1

Rd2.Update

MsgBox "This is your first" & rd2.fields ("Times") & "Use this system, you still have" & 30 - (Date - Rd2.fields ("first_time") & "Trial period, wish You have a good job today! ", 48," Tianhua Computer Creative Studio "

'Effect is shown in Figure 2 (see Annex 2)

Mainform.show 'Start your main form

END IF

END IF

EXIT SUB

Error:

Msgbox "System error!"

End Sub

Ok, I finally wrote the problem of our software trial period. How, it is not difficult, and doesn't have to modify the registry information, so a general master will think of the registry to modify or restore the original registry, but this It is no more important, and my method has an important feature that I can only install this system once, because when it unresses the original program, I want to install it, huh, huh, because Date.mdb still exists, so Really controlled only one time, use 30 days of deadline, is it more cool than Dreamwaver. If you want to reinstall, just add a small program, delete the database file. If you use this method, combination Registration, I think the effect is better, huh, okay, just like this, I don't forget to write a letter, tell me:

Springlover@263.net

转载请注明原文地址:https://www.9cbs.com/read-61361.html

New Post(0)