Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (1 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
Comments
Sergey Alexandrovich Kryukov 5-Mar-13 1:24am    
Unzip quickly... :-)
—SA
kk2014 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.
kk2014 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900