public DateTime GetLastModificationDateTime()
{
string currentPageFilename = Context.Request.PhysicalPath;
if (System.IO.File.Exists(currentPageFilename))
return System.IO.File.GetLastWriteTime(currentPageFilename);
}
else
return DateTime.Now;
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Last Modified Date Time: <%= GetLastModificationDateTime().ToString("dd-mmm-yyyy HH:mm:ss") %>
</div>
</form>
</body>
</html>
/// <summary>
/// Summary description for SmartPage
/// </summary>
public class SmartPage : System.Web.UI.Page
public SmartPage()
//
// TODO: Add constructor logic here
public partial class LastPageModificationDate : SmartPage
protected void Page_Load(object sender, EventArgs e)
Show Comments (0)
Loading Comments. Please Wait...