File date as runtime...

Discussion in 'ASP .Net' started by EMW, Apr 11, 2004.

  1. EMW

    EMW Guest

    Hi,

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

    rg,
    Eric
     
    EMW, Apr 11, 2004
    #1
    1. Advertising

  2. 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
     
    =?Utf-8?B?QXNoaXNoIE0gQmhvbmtpeWE=?=, Apr 12, 2004
    #2
    1. Advertising

  3. EMW

    EMW Guest

    Thank you!

    rg,
    Eric

    "Ashish M Bhonkiya" <> schreef in bericht
    news:...
    > 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 :" +

    myfileinfo.CreationTime.ToString()+"<br>");
    > Response.Write( "Last Updated Time:" +

    myfileinfo.LastWriteTime.ToString()+"<br>");
    >
    > }
    >
    > HTH
    > Ashish M Bhonkiya
    >
    > ----- EMW wrote: -----
    >
    > Hi,
    >
    > Is it possible to get the date on which the aspx file was

    created/last saved
    > at runtime?
    >
    > rg,
    > Eric
    >
    >
    >
     
    EMW, Apr 12, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    610
    Matthew Speed
    Nov 8, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,285
    Michael Borgwardt
    May 30, 2004
  3. Matt
    Replies:
    2
    Views:
    522
    Pete Becker
    Nov 8, 2003
  4. Matt
    Replies:
    3
    Views:
    728
    Richard Heathfield
    Nov 8, 2003
  5. Matt
    Replies:
    11
    Views:
    409
    Aaron Bertrand [MVP]
    Nov 8, 2003
Loading...

Share This Page