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

SetLastWriteTimeInternal() private static méthode

private static SetLastWriteTimeInternal ( string fullPath, DateTimeOffset time, bool asDirectory ) : void
fullPath string
time DateTimeOffset
asDirectory bool
Résultat void
        private static void SetLastWriteTimeInternal(string fullPath, DateTimeOffset time, bool asDirectory)
        {
            using (SafeFileHandle handle = OpenHandle(fullPath, asDirectory))
            {
                bool r = Interop.Kernel32.SetFileTime(handle, lastWriteTime: time.ToFileTime());
                if (!r)
                {
                    throw Win32Marshal.GetExceptionForLastWin32Error(fullPath);
                }
            }
        }