摘 要:通过读取文件的各日期,防止修改系统时间来避开试用期的程序。同时也能一定限度的防止通过备份文件的方式来避开试用期。 未做严格测试.
正 文:
Private Sub FORM_Load() Dim dd As String dd = CurrentProject.Path If Right(dd, 1) <> "\" Then dd = dd & "\" ShowFileAccessInfo dd & CurrentProject.Name End Sub Sub ShowFileAccessInfo(filespec) Dim fs, f, s, aa, bb, cc Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(filespec) aa = f.DateCreated '建立日期 bb = f.DateLastAccessed '最后访问日期 cc = f.DateLastModified '最后更新日期 If aa > bb Then GoTo ww: If aa > cc Then GoTo ww: If bb > cc Then GoTo ww: If cc > Date Then GoTo ww: Exit Sub ww: MsgBox "请不要修改系统日期!": Quit End Sub | |