如何限制软件的使用期限?
比如我开发了个小软件,想给软件加个试用期(以30天为例),超过30天软件自动停止运行,并提醒用户注册付费,请各位大侠指点小弟该怎么解决?不胜感谢!!!
小弟开发的软件网址:
天空软件站:http://shareware.skycn.com/author_softlist.php?author_id=26655,华军也有,呵呵
[解决办法]
1、在注册表的某个地方做个标记
2、在ini的某个地方做标记
3、在硬盘某个文件中做标记
4、在背景图的位信息中写入时间信息。
不过说实在话,这些都挺容易破的,但是常用的也就这几种。
象金山词霸,就是ini文件
[解决办法]
没法绝对,许多方法都可以轻易破解
[解决办法]
Private Type FirstDate
day As Integer
month As Integer
year As Integer
End Type
Private Sub Command1_Click()
Dim times As Integer
times = GetSetting("use", "soft", "times", "5")
If times = 5 Then
首次使用
SaveSetting "use", "soft", "times", 10
SaveSetting "use", "soft", "date", day(Date)
SaveSetting "use", "soft", "date", month(Date)
SaveSetting "use", "soft", "date", year(Date)
Else
FirstDate.day = Int(GetSetting("use", "soft", "date", day(Date)))
FirstDate.month = Int(GetSetting("use", "soft", "date", day(month)))
FirstDate.year = Int(GetSetting("use", "soft", "date", day(year)))
' ....... 天數的的算法自己寫
End If
End Sub
[解决办法]
没有有效的办法,还是买授权吧。
[解决办法]
上次太累了,寫錯了,這次作為補嘗,幫你寫全了
Private Sub Command1_Click()
Dim FirstDay As Integer
Dim FirstMonth As Integer
Dim NowDay As Integer
Dim NowMonth As Integer
Dim NowYear As Integer
Dim AddDay(12) As Integer
Dim times As Integer
times = GetSetting("use", "soft", "times", "5")
If times = 5 Then '判斷是是否首次使用
'首次使用
SaveSetting "use", "soft", "times", 10
SaveSetting "day", "use", "date", day(Date)
SaveSetting "month", "use", "date", month(Date)
Else
FirstDay = Val(GetSetting("day", "use", "date", day(Date)))
FirstMonth = Val(GetSetting("month", "use", "date", month(Date)))
NowDay = day(Date)
NowMonth = month(Date)
AddDay(1) = 31
AddDay(2) = 28 '平年
AddDay(3) = 31
AddDay(4) = 30
AddDay(5) = 31
AddDay(6) = 30
AddDay(7) = 31
AddDay(8) = 31
AddDay(9) = 30
AddDay(10) = 31
AddDay(11) = 31
AddDay(12) = 30
If NowMonth = FirstMonth Then
If (NowDay - FirstDay) >= 30 Then TheEnd
Else
If (NowDay + AddDay(NowMonth) - FirstDay) >= 30 Then TheEnd
End If
End If
End Sub
Sub TheEnd()
MsgBox ("軟件試用以到期!")
End
End Sub
[解决办法]
to myhongye:
datediff("d", dt1, dt2) 就可以求两个日期的日数差,没必要那么麻烦。
[解决办法]
限制使用次数还好点!
既简单又实用,人家改时间你怎么办
[解决办法]
千万不要用VB提供的操作注册表的函数,一定要用Win32 API!