[DllImport("kernel32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetFileAttributesEx(string lpFileName,
GET_FILEEX_INFO_LEVELS fInfoLevelId, IntPtr lpFileInformation);
[DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetFileAttributesEx(string lpFileName,
GET_FILEEX_INFO_LEVELS fInfoLevelId, out WIN32_FILE_ATTRIBUTE_DATA fileData);
None.
Please add some!
public static bool GetFileAttributesEx(string lpFileName, out WIN32_FILE_ATTRIBUTE_DATA fileData) {
return GetFileAttributesEx(lpFileName, GET_FILEEX_INFO_LEVELS.GetFileExInfoStandard,
out fileData);
}
WIN32 fileData;
if (GetFileAttributesEx(path, GET_FILEEX_INFO_LEVELS.GetFileExInfoStandard, out fileData))
{
lastAccessTime = GetDateTimeFromFILETIME(fileData.ftLastAccessTime);
lastModifiedTime = GetDateTimeFromFILETIME(fileData.ftLastWriteTime);
}
else
{
throw new ApplicationException("Unable to obtain details for path " + path);
}
}
Do you know one? Please contribute it!