主题:一个问题时间的问题
我在VB资源添加了一个 DAT格式的文件,但是每次释放到我指定的路径的时候他的 创建日期 修改日期
访问日期都被修改成当前的日期了。是不是VB释放日期都是这样子的!!
一下是我的源码:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessID As Long) As Long
Private Declare Function GetModuleFileNameExA Lib "psapi.dll" (ByVal hProcess As Long, ByVal hModule As Long, ByVal ModuleName As String, ByVal nSize As Long) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Private Declare Function EnumProcessModules Lib "psapi.dll" (ByVal hProcess As Long, ByRef lphModule As Long, ByVal cb As Long, ByRef cbNeeded As Long) As Long
Private Sub Command13_Click()
Dim notepad_hwnd As Long, i As Long, pid As Long, q As Long
Dim notepad_path As String
Dim delimeter As String
Dim Map_path() As String
Dim the_Map_path As String
Dim b() As Byte
Dim c() As Byte
Dim notepad_hwnd1 As Long
notepad_hwnd& = FindWindow(vbNullString, "英雄联盟登录程序")
i = GetWindowThreadProcessId(notepad_hwnd, pid)
notepad_path = GetProcessPathByProcessID(pid)
delimeter = "\"
Map_path = Split(notepad_path, "TCLS")
the_Map_path = Map_path(0) & "Binaries\Win32"
Text1 = the_Map_path
Kill (Text1 & ".\dm.dll")
Kill (Text1 & ".\dats.dat")
b = LoadResData(101, "CUSTOM")
Open Text1 & ".\dm.dat" For Binary As #1
Put #1, 1, b
Close #1
c = LoadResData(102, "CUSTOM")
Open Text1 & ".\dmts.dll" For Binary As #2
Put #2, 2, c
Close #2
End Sub
我的意思就是想这样子, 在点击Command13的时候 获取当前系统的时间
然后在释放资源的前面修改一下系统时间。修改我指定的时间
然后释放完成以后 在恢复开始前的时间
这是我的一个思路。
还有一个直接修改指定文件 dm.dat 的创建日期 修改日期 上次访问时间 但是我水平有限 不会。
那位朋友帮帮忙 修改一下。个人觉得 第2种办法好。但是复杂了点。
不胜感激!!
访问日期都被修改成当前的日期了。是不是VB释放日期都是这样子的!!
一下是我的源码:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessID As Long) As Long
Private Declare Function GetModuleFileNameExA Lib "psapi.dll" (ByVal hProcess As Long, ByVal hModule As Long, ByVal ModuleName As String, ByVal nSize As Long) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Private Declare Function EnumProcessModules Lib "psapi.dll" (ByVal hProcess As Long, ByRef lphModule As Long, ByVal cb As Long, ByRef cbNeeded As Long) As Long
Private Sub Command13_Click()
Dim notepad_hwnd As Long, i As Long, pid As Long, q As Long
Dim notepad_path As String
Dim delimeter As String
Dim Map_path() As String
Dim the_Map_path As String
Dim b() As Byte
Dim c() As Byte
Dim notepad_hwnd1 As Long
notepad_hwnd& = FindWindow(vbNullString, "英雄联盟登录程序")
i = GetWindowThreadProcessId(notepad_hwnd, pid)
notepad_path = GetProcessPathByProcessID(pid)
delimeter = "\"
Map_path = Split(notepad_path, "TCLS")
the_Map_path = Map_path(0) & "Binaries\Win32"
Text1 = the_Map_path
Kill (Text1 & ".\dm.dll")
Kill (Text1 & ".\dats.dat")
b = LoadResData(101, "CUSTOM")
Open Text1 & ".\dm.dat" For Binary As #1
Put #1, 1, b
Close #1
c = LoadResData(102, "CUSTOM")
Open Text1 & ".\dmts.dll" For Binary As #2
Put #2, 2, c
Close #2
End Sub
我的意思就是想这样子, 在点击Command13的时候 获取当前系统的时间
然后在释放资源的前面修改一下系统时间。修改我指定的时间
然后释放完成以后 在恢复开始前的时间
这是我的一个思路。
还有一个直接修改指定文件 dm.dat 的创建日期 修改日期 上次访问时间 但是我水平有限 不会。
那位朋友帮帮忙 修改一下。个人觉得 第2种办法好。但是复杂了点。
不胜感激!!