File date as runtime...

E

EMW

Hi,

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

rg,
Eric
 
G

Guest

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
 
E

EMW

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 :" +
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top