防止Access 2000密码被破译的方法
stemTimeToFileTime Lib "kernel32" _ (lpSystemTime As SYSTEMTIME, lpFileTime As FILETIME) As Long Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" _ (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal _ dwShareMode As Long, ByVal lpSecurityAttributes As Long, ByVal _ dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, _ ByVal hTemplateFile As Long) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) _ As Long Private Declare Function LocalFileTimeToFileTime Lib "kernel32" _ (lpLocalFileTime As FILETIME, lpFileTime As FILETIME) As Long Private Sub Command1_Click() Dim Year As Integer, Month As Integer, Day As Integer Dim Hour As Integer, Minute As Integer, Second As Integer Dim TimeStamp As Variant, Filename As String, X As Integer Year = 2001: Month = 3: Day = 13 ' 准备设定的“创建日期” Hour = 12: Minute = 0: Second = 26 TimeStamp = DateSerial(Year, Month, Day) + TimeSerial(Hour, Minute, Second) Filename = "D:\VB6_Test\MDB_Password\Pass_Protected_DB.mdb" ' 目标文件名 X = ModifyFileStamp(Filename, TimeStamp) End Sub Function ModifyFileStamp(Filename As String, TimeStamp As Variant) As Integer Dim X As Long, Handle As Long, System_Time As SYSTEMTIME Dim File_Time As FILETIME, Local_Time As FILETIME System_Time.wYear = Year(TimeStamp): System_Time.wMonth = Month(TimeStamp) System_Time.wDay = Day(TimeStamp) System_Time.wDayOfWeek = Weekday(TimeStamp) - 1 System_Time.wHour = Hour(TimeStamp): System_Time.wSecond = Second(TimeStamp) System_Time.wMilliseconds = 0 X = SystemTimeToFileTime(System_Time, Local_Time) X = LocalFileTimeToFileTime(Local_Time, File_Time) ' 转换成可用的类型 Handle = CreateFile(Filename, GENERIC_WRITE, FILE_SHARE_READ Or _ FILE_SHARE_WRITE, ByVal 0&, OPEN_EXISTING, 0, 0) ' 打开文件 X = SetFileTimeWrite(Handle, File_Time, ByVal 0&, ByVal 0&) ' 设置日期 CloseHandle Handle ' 关闭文件 End Function 图三显示的是数据库的真实“创建日期”以及经程序二伪装的操作系统级的“假象”日期。
|
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |