"The FUNCTION ulong OpenFile (ref string lpFileName, ref str_s_OFSTRUCT lpReOpenBuff, ulong wStyle) LIBRARY "kernel32. DLL
"The FUNCTION ulong FileTimeToSystemTime (ref str_s_FILETIME lpFileTime, ref str_s_SYSTEMTIME lpSystemTime) LIBRARY "kernel32. DLL
"The FUNCTION ulong CloseHandle (ulong hObject) LIBRARY "kernel32. DLL
"/* structure definition
Type str_s_FileTime from structure
Unsignedlong l_time
Unsignedlong h_time
End type
Type str_s_OFSTRUCT from structure
Unsignedinteger cBytes
Unsignedinteger fFixedDisk
The integer nErrCode
The integer Reserved1
The integer Reserved2
Character szPathName [128]
End type
Type str_s_systemtime from structure
The integer wYear
The integer wMonth
The integer wDayOfWeek
The integer wDay
The integer wHour
The integer wMinute
The integer wSecond
The integer wMilliseconds
End type
program source code
Ulong lul_hFile
Str_s_ofstruct lst_ofstruct
String ls_date, ls_time
Datetime ldt_return
String as_filename="d: \ temp2\2. GIF"
Str_s_filetime lst_filetime1 lst_filetime2, lst_filetime3
Str_s_SYSTEMTIME LST_SYSTEMTIME
Int ai_type
Ai_type=1
Lul_hFile=openfile (as_filename lst_ofstruct, 0)//handle to take
GetFileTime (lul_hFile lst_filetime1, lst_filetime2 lst_filetime3)//take time
If ai_type=1 then//take creation time
FileTimeToSystemTime (LST_FileTime1, LST_SYSTEMTIME)//UTC format into the system time format
Elseif ai_type=2 then//remove access time
FileTimeToSystemTime (LST_FileTime2, LST_SYSTEMTIME)//UTC format into the system time format
Elseif ai_type=3 then//take modification time
FileTimeToSystemTime (LST_FileTime3, LST_SYSTEMTIME)//UTC format into the system time format
End the if
The CloseHandle (lul_hFile)
Ls_date=string (lst_systemtime wYear, '0000') + '-' + string (lst_systemtime wMonth, '00') + '-' + string (lst_systemtime wDay, '00')
Ls_time=string (lst_systemtime wHour, '00') + ', '+ string (lst_systemtime wMinute,' 00 ') + ', '+ string (lst_systemtime wSecond,' 00 ')
Ldt_return=datetime (date (ls_date), time (ls_time))
Messagebox (' 1 ', the string (ldt_return))
The return value of a program is running less than value, openfile is 4294967295, please help to see what's wrong?
CodePudding user response:
4294967295 returns this should take less than a file handle isCodePudding user response:
Time is the southern districtCodePudding user response:
To save the following as a local file n_cst_filetime. Sru, then import the PBL$PBExportHeader $n_cst_filetime. Sru
$PBExportComments $external functions related to the file time
Forward
Global type n_cst_filetime from nonvisualobject
End type
Type os_filedatetime from structure within n_cst_filetime
End type
Type os_fileopeninfo from structure within n_cst_filetime
End type
Type os_finddata from structure within n_cst_filetime
End type
Type os_securityattributes from structure within n_cst_filetime
End type
Type os_systemtime from structure within n_cst_filetime
End type
End forward
Type os_filedatetime from structure
Unsignedlong ul_lowdatetime
Unsignedlong ul_highdatetime
End type
Type os_fileopeninfo from structure
Character c_length
Character c_fixed_disk
Unsignedinteger ui_dos_error
Unsignedinteger ui_na1
Unsignedinteger ui_na2
Character c_pathname [128]
End type
Type os_finddata from structure
Unsignedlong ul_fileattributes
Os_filedatetime str_creationtime
Os_filedatetime str_lastaccesstime
Os_filedatetime str_lastwritetime
Unsignedlong ul_filesizehigh
Unsignedlong ul_filesizelow
Unsignedlong ul_reserved0
Unsignedlong ul_reserved1
Character ch_filename [260]
Character ch_alternatefilename [14]
End type
Type os_securityattributes from structure
Unsignedlong ul_length
String ch_description
Boolean b_inherit
End type
Type os_systemtime from structure
Unsignedinteger ui_wyear
Unsignedinteger ui_wmonth
Unsignedinteger ui_wdayofweek
Unsignedinteger ui_wday
Unsignedinteger ui_whour
Unsignedinteger ui_wminute
Unsignedinteger ui_wsecond
Unsignedinteger ui_wmilliseconds
End type
Global type n_cst_filetime from nonvisualobject autoinstantiate
End type
The type as
//get the application name
//Function uint GetModuleFileNameA (ulong hModule, ref string lpFilename, ulong nSize) Library "kernel32. DLL"//access application running directory
//file operations
The Function long FindFirstFileA (ref string filename, ref os_finddata findfiledata) library "kernel32. DLL
"nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull