设为首页 加入收藏

TOP

pb9获取文件创建时间、最后修改时间及设置最后修改时间的方法(一)
2014-11-23 22:54:19 来源: 作者: 【 】 浏览:25
Tags:pb9 获取 文件 创建 时间 最后 修改 设置 方法

将以下内容保存为本地文件n_cst_filetime.sru,然后导入pbl中
[cpp]
$PBExportHeader$n_cst_filetime.sru
$PBExportComments$与文件时间有关的外部函数
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

type prototypes
//获得应用程序名用
//Function uint GetModuleFileNameA(ulong hModule,ref string lpFilename,ulong nSize) Library "kernel32.dll" //获取应用程序运行目录

//文件操作
Function long FindFirstFileA (ref string filename, ref os_finddata findfiledata) library "kernel32.dll"
Function boolean FindNextFileA (long handle, ref os_finddata findfiledata) library "kernel32.dll"
Function boolean FindClose (long handle) library "kernel32.dll"
Function long OpenFile (ref string filename, ref os_fileopeninfo of_struct, ulong action) LIBRARY "kernel32.dll"
Function boolean CloseHandle (long file_hand) LIBRARY "kernel32.dll"
Function boolean GetFileTime(long hFile, ref os_filedatetime lpCreationTime, ref os_filedatetime lpLastAccessTime, ref os_filedatetime lpLastWriteTime ) library "kernel32.dll"
Function boolean FileTimeToSystemTime(ref os_filedatetime lpFileTime, ref os_systemtime lpSystemTime) library "kernel32.dll"
Function boolean FileTimeToLocalFileTime(ref os_filedatetime lpFileTime, ref os_filedatetime lpLocalFileTime) library "kernel32.dll"
Function boolean SetFileTime(long hFile, os_filedatetime lpCreationTime, os_filedatetime lpLastAccessTime, os_filedatetime lpLastWriteTime ) library "kern
首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇SybaseIQ建立代理表 下一篇SybSQLException: The datastream..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: