当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·    »显示摘要«
    摘要: 我用vb做了个打印控件,编译好,打包成htm文件,然后放在服务器上,这样客户端可以直接下载了,但是我碰到了一件很奇怪的事,有些机器可以下载,而有些机器不能下载(我的意思指能够下载的机器就是能看到这两个控件,但是不能下载的就看不到这两个控件了),拜托哪位高手帮帮忙吧 ......
 ·救win2000的数据恢复    »显示摘要«
    摘要: 本人昨天改动了syetem32文件夹后,造成分区表损坏,修复之后,系统提示“档案损坏”,要求每个分区都格式化。 怎么办? 不想format,只想恢复数据。 请高手指点。问题解决即结账!! 还有,用win2000的系统恢复盘可以吗? 该怎么做? 谢谢! ......


如何修改文件的"创建""修改"和"访问"时间

因为要写工作日总结,以前的都没有写,今天要一起给补上.总结  
   
  的形式是一个一个的word文档,要是让老板看到它们都是一天  
   
  建的就不好了。所以才想到用程序来修改这三个时间.  
  我用filesystemobject得到file,但是fi  
   
  le的datecreated/datelastaccess  
   
  d/datelastmodified都是只读属性。怎么才能  
   
  改呢?  
   
  希望跟大家探讨探讨.

NO.1   作者: jjweid

给我信箱   我给你例子~

NO.2   作者: yefanqiu

【声明】  
  Public   Declare   Function   SetFileTime   Lib   "kernel32"   Alias   "SetFileTime"   (ByVal   hFile   As   Long,   lpCreationTime   As   FILETIME,   lpLastAccessTime   As   FILETIME,   lpLastWriteTime   As   FILETIME)   As   Long  
  【说明】  
  设置文件的创建、访问及上次修改时间  
  【返回值】  
  Long,非零表示成功,零表示失败。会设置GetLastError  
  【参数表】  
      hFile   ----------     Long,系统文件句柄  
   
      lpCreationTime   -     FILETIME,文件的创建时间  
   
      lpLastAccessTime   -     FILETIME,文件上一次访问的时间  
   
      lpLastWriteTime   -     FILETIME,文件最近一次修改的时间  
   
   
 

NO.3   作者: qbilbo

以下是要用到的API函数,如果还不能解决,mail   to   :qbilbo@kali.com.cn。  
  我发个测试程序给你。  
   
  用于改变文件创建日期,最后修改日期的API,数据类型及常量。  
  Private   Type   FILETIME  
          dwLowDateTime   As   Long  
          dwHighDateTime   As   Long  
  End   Type  
   
  Public   Type   SYSTEMTIME  
          wYear   As   Integer  
          wMonth   As   Integer  
          wDayOfWeek   As   Integer  
          wDay   As   Integer  
          wHour   As   Integer  
          wMinute   As   Integer  
          wSecond   As   Integer  
          wMilliseconds   As   Integer  
  End   Type  
   
  Private   Const   GENERIC_READ   =   &H80000000  
  Private   Const   GENERIC_WRITE   =   &H40000000  
  Private   Const   OPEN_EXISTING   =   3  
  Private   Const   FILE_SHARE_READ   =   &H1  
  Private   Const   FILE_SHARE_WRITE   =   &H2  
   
  获取文件句柄  
  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  
  获取文件UTC时间信息中的创建日期和最后修改日期  
  Private   Declare   Function   GetFileTime   Lib   "kernel32"   (ByVal   hFile   As   Long,   lpCreationTime   As   FILETIME,   _  
                                                    ByVal   lpLastAccessTime   As   Long,   lpLastWriteTime   As   FILETIME)   As   Long  
  设置文件创建日期,最后修改日期  
  Private   Declare   Function   SetFileTime   Lib   "kernel32"   (ByVal   hFile   As   Long,   lpCreationTime   As   FILETIME,   _  
                                                    lpLastAccessTime   As   FILETIME,   lpLastWriteTime   As   FILETIME)   As   Long  
  将系统日期格式转换成本地日期格式  
  Private   Declare   Function   SystemTimeToFileTime   Lib   "kernel32"   (lpSystemTime   As   SYSTEMTIME,   _  
                                                    lpFileTime   As   FILETIME)   As   Long  
  将本地日期格式转换成系统日期格式  
  Private   Declare   Function   FileTimeToSystemTime   Lib   "kernel32"   (lpFileTime   As   FILETIME,   _  
                                                    lpSystemTime   As   SYSTEMTIME)   As   Long  
  将UTC时间信息转换成本也时间信息  
  Private   Declare   Function   FileTimeToLocalFileTime   Lib   "kernel32"   (lpFileTime   As   FILETIME,   _  
                                                    lpLocalFileTime   As   FILETIME)   As   Long  
  将本地文件时间转成UTC时间信息  
  Private   Declare   Function   LocalFileTimeToFileTime   Lib   "kernel32"   (lpLocalFileTime   As   FILETIME,   _  
                                                    lpFileTime   As   FILETIME)   As   Long  
  关闭文件  
  Private   Declare   Function   CloseHandle   Lib   "kernel32"   (ByVal   hObject   As   Long)   As   Long  
 

NO.4   作者: fbmsf

he   SetFileTime   function   sets   the   date   and   time   that   a   file   was   created,   last   accessed,   or   last   modified.    
  BOOL   SetFileTime(  
   
          HANDLE   hFile, //   identifies   the   file    
          CONST   FILETIME   *lpCreationTime, //   time   the   file   was   created    
          CONST   FILETIME   *lpLastAccessTime, //   time   the   file   was   last   accessed    
          CONST   FILETIME   *lpLastWriteTime   //   time   the   file   was   last   written    
        );  
 


 ·http问题高分    »显示摘要«
    摘要: 与http服务器(用wininternat类)连接以后,如果我想软件实现用户登陆,该怎么做???? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE