Click here to Skip to main content
11,705,763 members (50,589 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: DateTime update
Hi all,

i have req. to display latest version date(last modified date) in my application.
i did that. it is working fine.
string fullpath = Server.MapPath(Request.Url.AbsolutePath);
        string path = Path.GetDirectoryName(fullpath);
        System.IO.FileInfo loFile = new System.IO.FileInfo(path);
        DateTime created = loFile.LastWriteTime;
        lbldate.Text = created.ToString("dd-MM-yyyy");
problem is that i am making .zip file of my source code and upload on my ftp.
now it shows the date of when i unzip the file. instead i have to show last modified date.

ex. i made last change on 04-03-2013. it should show this date. but if i make .zip file and extract today(05-03-2013) then it shows the today's date.

so, how can i show last modified(latest code - 04-03-2013) date eve if i make .zip file on my code?

thanks,
kk
Posted 4-Mar-13 19:09pm
kk20141.9K
Comments
Sergey Alexandrovich Kryukov at 5-Mar-13 1:24am
   
Unzip quickly... :-)
—SA
kkakadiya at 5-Mar-13 1:30am
   
that's not the way...if i release .zip file today and client unzip it 2 days later and upload code then it should display 2 days previous date.
Richard MacCutchan at 5-Mar-13 6:03am
   
You can't; this is a feature of the operating system. The best way round this is to add version information in your project which includes the latest build date.
kkakadiya at 8-Mar-13 7:23am
   
hi Richard MacCutchan,

i have tried this also.
System.IO.File.GetLastWriteTime(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString("dd-MM-yyyy hh:mm:ss");

but no change. at last i have to upload code as .zip on ftp and then extract it and then replace old code with updated one.

there also build the code. so it will show that date.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 218
1 Sergey Alexandrovich Kryukov 170
2 Inimicos 60
3 ProgramFOX 50
4 Richard MacCutchan 45
0 OriginalGriff 9,037
1 Sergey Alexandrovich Kryukov 8,417
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,626


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 5 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100