C 獲取檔案的修改時間 訪問時間 建立時間

2021-07-24 21:32:37 字數 795 閱讀 3947

*屬性*                  *功能和用途*

attributes 返回和檔案相關的屬性值,運用了fileattributes列舉型別值

creationtime 返回檔案的建立時間

exists 檢查檔案是否存在於給定的目錄中

extension 返回檔案的副檔名

lastaccesstime 返回檔案的上次訪問時間

fullname 返回檔案的絕對路徑

lastwritetime 返回檔案的上次寫操作時間

name 返回給定檔案的檔名

delete() 刪除乙個檔案的方法,請務必謹慎地運用該方法

演示demo

fileinfo fi = new fileinfo("e:\\text.txt");

.tostring() + "寫入檔案的時間" + fi.lastwritetime + "訪問的時間" + fi.lastaccesstime);

datetime dt = system.datetime

.now

; string dt = system.datetime

.now

.tostring();

C 獲取檔案的修改時間 訪問時間 建立時間

屬性 功能和用途 attributes 返回和檔案相關的屬性值,運用了fileattributes列舉型別值 creationtime 返回檔案的建立時間 exists 檢查檔案是否存在於給定的目錄中 extension 返回檔案的副檔名 lastaccesstime 返回檔案的上次訪問時間 ful...

php獲取檔案建立時間 修改時間

filemtime string filename 返回檔案上次被修改的時間,出錯時返回 false。時間以 unix 時間戳的方式返回,可用於 date filectime string filename 返回檔案上次 inode 被修改的時間,如果出錯則返回 false。時間以 unix 時間戳...

Linux獲取檔案最後修改時間

使用ll指令檢視檔案資訊 root localhost urldata ll xsb90.txt rw rw r 1 zabbix zabbix 1660151 8月 1512 16 xsb90.txt其中包含檔案的最後修改時間,可以使用awk指令獲取其中的修改時間 root localhost u...