Results 1 to 2 of 2

Thread: File time stamps.

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    8

    Question File time stamps.

    In vb you can do this to get the time stamp of a file

    // get a time stamp of file
    filedate = FileDateTime(a_filename);

    Anyone know how do I get the same kind of thing
    in c#? Is there another system thing I have to include
    also?

    Many thanks folks

  2. #2
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476
    Code:
    using System.IO;
    .
    .
    .
    MessageBox.Show(File.GetCreationTime(Application.StartupPath + @"\test.xml").ToString());
    			
    MessageBox.Show(File.GetCreationTimeUtc(Application.StartupPath + @"\test.xml").ToString());
    Either one of them, whatever suits you best! There are a lot more and powerfull things you can do with File and Directory Classes, you should have a closer look at them, if you are working with files.

    Hope That Helps,

    Stephan
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

Posting Permissions

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



Click Here to Expand Forum to Full Width