新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Sub Command1_Click() Dim strFN As String strFN = App.Path & "\manongku.txt" MsgBox "文件的最后修改时间为:" & FileDateTime(strFN) End Sub
运行结果:
文件的最后修改时间为:2023/12/19 22:36:48