I'm writing a program that changes the modification date of all files in a directory.
I can apparantly change the properties, but not for windows to recognize it.
private static void ChangeDateTypeOfFile(DateTime date, string filepath)
{
int state = PdfReader.TestPdfFile(filepath);
if (state != 0)
{
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
PdfDocument doc = PdfReader.Open(filepath);
doc.Info.ModificationDate = date;
doc.Save(filepath);
}
else
{
Console.WriteLine(state);
}
}
When I read the property before and after I change it I can see the difference and it seems to work. Yet in Windows File Explorer I can't see any changes (nor with title
and author
for example). And the last modified date changes to when I ran the code.
How can I persistently change this information?
Edit:
When I open it with Notepad I can see the line:
/ModDate(D:20070129000000+01'00') //Set the date to 2007
Why does the file Explorer not display this information?