File date as runtime...

  • Thread starter Thread starter EMW
  • Start date Start date
E

EMW

Hi,

Is it possible to get the date on which the aspx file was created/last saved
at runtime?

rg,
Eric
 
Hi Eric
I have posted the reply but does not see it so again replying back to your thread

its is possible to do it during run time

take any page and put the following code in page_load method of the page and it should serve what u need

PS: you need to include System.IO namespace

private void Page_Load(object sender, System.EventArgs e

// Put user code to initialize the page her

FileInfo myfileinfo = new FileInfo(Server.MapPath(Request.ServerVariables["SCRIPT_NAME"]))
Response.Write(" File Name : " +myfileinfo.FullName +"<br>")
Response.Write( "Creation Time :" + myfileinfo.CreationTime.ToString()+"<br>")
Response.Write( "Last Updated Time:" + myfileinfo.LastWriteTime.ToString()+"<br>")



HT
Ashish M Bhonkiy

----- EMW wrote: ----

Hi

Is it possible to get the date on which the aspx file was created/last save
at runtime

rg
Eri
 
Thank you!

rg,
Eric

Ashish M Bhonkiya said:
Hi Eric,
I have posted the reply but does not see it so again replying back to your thread.

its is possible to do it during run time.

take any page and put the following code in page_load method of the page
and it should serve what u need.
PS: you need to include System.IO namespace.

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here

FileInfo myfileinfo = new FileInfo(Server.MapPath(Request.ServerVariables["SCRIPT_NAME"]));
Response.Write(" File Name : " +myfileinfo.FullName +"<br>");
Response.Write( "Creation Time :" +
 
Back
Top