PB 中如何读取工作目录下 所有后缀名为.pbd的文件 和文件日期 在线等 !解决后散分

zp_cool 2007-10-24 10:23:17
PB 中如何读取工作目录下 所有后缀名为.pbd的文件 和文件日期 在线等 !解决后散分
...全文
310 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zjoy 2007-10-24
  • 打赏
  • 举报
回复
哦,错了
是这个

Integer li_filerow ,li_i
String ls_text2
String ls_path2 ,ls_path
integer li_result
integer li_row

/*判断是否选择了系统名称*/
if isnull(gst_xtmc) or gst_xtmc = '' then
messagebox("GBInfo 系统提示:","请选择需要上传的系统名称。")
return
end if

if dw_loc.rowcount() > 0 then dw_loc.SelectRow(0,false)

li_result = GetFolder( "选择文件夹", ls_path )
if li_result <> 1 then
return
end if

ls_path2 = ls_path

if len(ls_path) > 3 then
ls_path+= "\*.*"
ls_path2+="\"
else
ls_path+="*.*"
end if

lb_txt.DirList(ls_path, 0)
li_filerow = lb_txt.TotalItems()

For li_i = 1 To li_filerow
ls_text2 = lb_txt.Text(li_i)
if dw_loc.Find("filename ='" + ls_text2 + "'" , 1, dw_loc.RowCount()) > 0 then
dw_loc.SelectRow(0,false)
dw_loc.SelectRow(dw_loc.Find("filename ='" + ls_text2 + "'" , 1, dw_loc.RowCount()), TRUE)
dw_loc.ScrollToRow(dw_loc.Find("filename ='" + ls_text2 + "'" , 1, dw_loc.RowCount()))
dw_loc.SetRow(dw_loc.Find("filename ='" + ls_text2 + "'" , 1, dw_loc.RowCount()))
messagebox("GBInfo 系统提示" ,"文件已经存在 !")
CONTINUE
End if

li_row = dw_loc.insertrow(0)
dw_loc.setitem(li_row,"subsys_id" ,gst_xtmc)
dw_loc.setitem(li_row,"filename" ,ls_text2)
dw_loc.setitem(li_row,"info" ,right(ls_text2,len(ls_text2) - pos(ls_text2,".")))
dw_loc.setitem(li_row,"scrq" ,nvo_compare.uf_File_GetDateTime(ls_path2 + ls_text2,2))
dw_loc.setitem(li_row,"path" ,ls_path2 + ls_text2)
dw_loc.accepttext()
next
zjoy 2007-10-24
  • 打赏
  • 举报
回复
找不到了,
这个是别人写的,你看看
http://topic.csdn.net/t/20060713/17/4878613.html
zp_cool 2007-10-24
  • 打赏
  • 举报
回复
有源吗吗?
zjoy 2007-10-24
  • 打赏
  • 举报
回复
可以采用listbox的dirlist方法来获取到所有的.pbd文件
然后遍历取到的文件,用getfiletime来获取文件的修改日期
FUNCTION ulong GetFileTime(ulong hFile,ref S_FILETIME lpCreationTime,ref S_FILETIME lpLastAccessTime,ref S_FILETIME lpLastWriteTime) LIBRARY "kernel32.dll"

S_FILETIME是个structure,
ulong dwLowDateTime
ulong dwHighDateTime

1,079

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧