>>484 >>485 レス有難うございます。
IntPtrってなんぞ、、、ってところから始まって、DllImportを初めて使ってみるまでに一日かかりました。ウヒー。
とりあえず日付は更新できるようになったものの、本当にこの書き方でよいのか激しく不安です。
添削していただけると有難いです。
[DllImport("coredll.dll")]
private static extern IntPtr CreateFile(String lpFileName, UInt32 dwDesiredAccess, UInt32 dwShareMode, IntPtr lpSecurityAttributes,
UInt32 dwCreationDisposition, UInt32 dwFlagsAndAttributes, IntPtr hTemplateFile);

[DllImport("coredll.dll")]
private static extern bool CloseHandle(IntPtr hObject);

[DllImport("coredll.dll")]
private static extern bool GetFileTime(IntPtr handle, ref FILETIME lpCreationTime, ref FILETIME lpLastAccessTime, ref FILETIME lpLastWriteTime);

[DllImport("coredll.dll")]
unsafe private static extern bool SetFileTime(IntPtr handle, FILETIME *lpCreationTime, FILETIME *lpLastAccessTime, FILETIME *lpLastWriteTime);

public struct FILETIME{
public UInt32 dwLowDateTime;
public UInt32 dwHighDateTime;
}
public struct FileTimes{
public FILETIME CreationTime;
public FILETIME LastAccessTime;
public FILETIME LastWriteTime;
}
unsafe static public bool SetFileTimeStamps(string path, FileTimes fileTimes){
IntPtr handle = CreateFile(path, 0x80000000, 0x00000001, IntPtr.Zero, 3, 0x00000080, IntPtr.Zero);
bool re = SetFileTime(handle, &fileTimes.CreationTime, &fileTimes.LastAccessTime, &fileTimes.LastWriteTime);
CloseHandle(handle);
return re;
}