Professional Web Applications Themes

site info? - ASP.NET General

hello, I need to display the last time the site was updated: I am trying to get FileInfo from web.config and get a last modified year of 1600. How do I get this info, is there a standard way? Thank you...

  1. #1

    Default site info?

    hello, I need to display the last time the site was
    updated: I am trying to get FileInfo from web.config and
    get a last modified year of 1600.

    How do I get this info, is there a standard way?

    Thank you
    szabelin Guest

  2. #2

    Default Re: site info?

    Would the last write time be appropriate? Not sure about a standard way, but
    here's one way:

    Private Sub Page_Load _
    (ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    Dim path As String = Server.MapPath("web.config")
    Dim fi1 As System.IO.FileInfo = _
    New System.IO.FileInfo(path)
    Label1.Text = "Last update: " & _
    fi1.LastWriteTime.ToLongDateString & _
    " at " & fi1.LastWriteTime.ToLongTimeString
    End Sub

    Does this help?

    Ken
    MVP [ASP.NET]


    --
    Microsoft MVPs have a question for *you*: Are you patched against the Worm?
    http://www.microsoft.com/security/security_bulletins/ms03-026.asp



    "szabelin" <szabelinszabelin> wrote in message
    news:05c301c36cf5$f3d5d390$gbl...
    hello, I need to display the last time the site was
    updated: I am trying to get FileInfo from web.config and
    get a last modified year of 1600.

    How do I get this info, is there a standard way?

    Thank you


    Ken Guest

  3. #3

    Default Re: site info?


    Hm.. I had it almost the same except I didn't do MapPath:
    (new FileInfo("web.config")).LastWriteTime was returning
    year 1600. It works with MapPath though. I am just curios
    now what's year 1600 about. Thanks for help.


     
    a standard way, but 
    against the Worm? 
    026.asp 
    szabelin Guest

  4. #4

    Default Re: site info?

    I think it's Microsoft not willing to return null objects when they should.
    So they return a minimum valid date value here instead of more accurate null
    object when there is no date available.

    Jerry

    "szabelin" <szabelinszabelin> wrote in message
    news:0f9501c36d05$9e6c0810$gbl... 
    > a standard way, but 
    > against the Worm? 
    > 026.asp [/ref]


    Jerry Guest

  5. #5

    Default Re: site info?

    > I am just curios now what's year 1600 about.

    Maybe it was working for you, but your web.config is older than most? <just
    joking!>


    --
    Microsoft MVPs have a question for *you*: Are you patched against the Worm?
    http://www.microsoft.com/security/security_bulletins/ms03-026.asp



    "szabelin" <szabelinszabelin> wrote in message
    news:0f9501c36d05$9e6c0810$gbl...

    Hm.. I had it almost the same except I didn't do MapPath:
    (new FileInfo("web.config")).LastWriteTime was returning
    year 1600. It works with MapPath though. I am just curios
    now what's year 1600 about. Thanks for help.


     
    a standard way, but 
    against the Worm? 
    026.asp 


    Ken Guest

  6. #6

    Default Re: site info?

    You are right they are returning 'DateTime.MinValue' since
    struct objects can't be null :)

    I'd rather they had something like DateTime.NotSet and so
    subsequent calls would throw exception ...




     
    when they should. 
    more accurate null [/ref]
    MapPath: [/ref]
    curios [/ref][/ref]
    about [/ref][/ref]
    patched 
    >http://www.microsoft.com/security/security_bulletins/ms03- [/ref][/ref]
    and [/ref]
    >
    >
    >.
    >[/ref]
    szabelin Guest

Similar Threads

  1. How do I work out the site logon info in the contributekey?
    By Oyinade in forum Macromedia Contribute Connection Administrtion
    Replies: 1
    Last Post: October 3rd, 08:03 PM
  2. User upgrade - now cannot find site info
    By mjwillyone in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: July 13th, 07:22 PM
  3. Newbie: grab info from a site
    By steve in forum PHP Development
    Replies: 1
    Last Post: October 20th, 08:05 AM
  4. Get info from a site with PHP
    By Jean in forum PHP Development
    Replies: 5
    Last Post: September 5th, 10:18 PM
  5. HELP!!! Dreamweaver ate all my site's info!
    By davidlieb webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 5
    Last Post: July 14th, 09:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139