I have a AsyncFileupload control on .aspx page where I am uploading an image. I am extracting very basic file information such as date created/accessed.
For every single file, the code gives me one static value that is
01/01/1601 00:00:00
Which obviously cannot be right. I am sure that there is a conversion is done automatically behind.
How can I convert it into actual value AND convert it back into CYYMMDD format (i want this particular format in bd)?
Thanks
on UploadedComplete i run this code
string savePath = MapPath("~/" + Path.GetFileName(e.FileName));
FileInfo MyFileInfo = new FileInfo(savePath);
txt_Textbox1.Text = MyFileInfo.CreationTime.ToString();
this always gives me following output, regardless the actual date is today’s date
01/01/1601 00:00:00
How can i convert it into its original creation date?
Make sure that
MyFileInfo.Existsistruebefore you use other properties of FileInfo variable.I’m sure in your case the
MyFileInfo.Existsisfalse. That’s the reason you’ll get those values for the properties likeCreationTime, LastAccessTime, LastWriteTimeetc.