FileInfo的显示一个奇特的日期奇特、日期、FileInfo

2023-09-06 06:13:21 作者:孤我为王

为什么下面显示1600年12月31日???

Why does the following display 12/31/1600 ???

Imports System.IO

Module Module1

Sub Main()
    Dim fi As New FileInfo("DocFiles\phillips_phone_number.txt")
    Console.WriteLine(fi.FullName)
    Console.WriteLine(fi.LastAccessTime.ToShortDateString)
    Console.ReadKey()
End Sub

前端模块

推荐答案

看来,code是无法找到文件,请参阅SDK中的 http://msdn.microsoft.com/en-us/library/system.io.file .getlastaccesstime.aspx

It seems that code is not able to find the file, see the documentation for the GetLastAccessTime function in the SDK http://msdn.microsoft.com/en-us/library/system.io.file.getlastaccesstime.aspx

据指出,

如果在文件中的路径描述   参数不存在,该方法   返回午夜12点,1月1日,   公元1601(C.E.)协调通用   时间(UTC),调整为本地时间。

If the file described in the path parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC), adjusted to local time.

 
精彩推荐
图片推荐