vb 獲取檔案的時間屬性

2021-04-25 01:06:59 字數 534 閱讀 6196

sub   showfileaccessinfo(filespec)  

dim   fs,   f,   s  

set   fs   =   createobject("scripting.filesystemobject")  

set   f   =   fs.getfile(filespec)  

s   =   ucase(filespec)   &   vbcrlf  

s   =   s   &   "created:   "   &   f.datecreated   &   vbcrlf  

s   =   s   &   "last   accessed:   "   &   f.datelastaccessed   &   vbcrlf  

s   =   s   &   "last   modified:   "   &   f.datelastmodified  

msgbox   s,   0,   "file   access   info"  

end   sub

VB程式訪問檔案的屬性

dim fso as object,folder as object,file as object dim fil as object dim strfilename as string dim strlastaccesseddate as string set fso createobject s...

VB 改變檔案唯讀屬性

setattr 語句 為乙個檔案設定屬性資訊。語法 setattr pathname,attributes setattr 語句的語法含有以下這些命名引數 部分 描述 pathname 必要引數。用來指定乙個檔名的字串表示式,可能包含目錄或資料夾 以及驅動器。attributes 必要引數。常數或數...

vb 讀取檔案屬性

如果只是檢視大小 修改時間的話,可以直接使用vb內建函式 返回檔案位元組大小 filelen 檔案路徑 示例 private sub form load dim sout as string const sfile as string c windows notepad.exe sout 檔案路徑 ...