System.IO.Win32FileSystem.GetCreationTime C# (CSharp) Méthode

GetCreationTime() public méthode

public GetCreationTime ( string fullPath ) : DateTimeOffset
fullPath string
Résultat DateTimeOffset
        public override DateTimeOffset GetCreationTime(string fullPath)
        {
            Interop.Kernel32.WIN32_FILE_ATTRIBUTE_DATA data = new Interop.Kernel32.WIN32_FILE_ATTRIBUTE_DATA();
            int errorCode = FillAttributeInfo(fullPath, ref data, false, false);
            if (errorCode != 0)
                throw Win32Marshal.GetExceptionForWin32Error(errorCode, fullPath);

            long dt = ((long)(data.ftCreationTimeHigh) << 32) | ((long)data.ftCreationTimeLow);
            return DateTimeOffset.FromFileTime(dt);
        }