Click here to Skip to main content
13,292,997 members (100,783 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
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 20:09pm
kk20142K
Comments
   
Unzip quickly... :-)
—SA
kkakadiya 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 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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.171207.1 | Last Updated 5 Mar 2013
Copyright © CodeProject, 1999-2017
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