AnsweredAssumed Answered

vrf .NET file info

Question asked by VRFuser on Jun 2, 2006

Thanks, Shawn, that works perfectly!
Regards,
Lee

Lee Hudson, R&D Scientist
Philips Lumileds Lighting Company
370 West Trimble Road, MS-91ML
San Jose, CA 95131
+1 408 964 2658
+1 408 964 5284
lee.hudson_2@philips.com
http://www.philipslumileds.com

"Shawn Fessenden" <shawnfess@comcast.net> wrote on 06/02/2006 08:38:15 AM:

> > Does anyone know how to use the
> > DateTime.Compare(t1,t2) function
>
> This is a static function that compares two DateTime objects. The result is
> less than zero if t1 is less than t2, zero if equal or greater than zero if
> t1 is greater than t2. See also member CompareTo.
>
> Cut the ToString off the end of the default formula - you want DateTime
> objects, not strings.
>
> Set t1 = System.IO.File.GetLastAccessTime("c:\ntldr");
> Set t2 = System.DateTime.Now;
> Set uptime = System.DateTime.op_Subtraction(t2, t1);
>
> // (Should) always return negative.
> comp1 = System.DateTime.Compare(t1, t2);
>
> // (Should) always return positive.
> comp2 = System.DateTime.Compare(t2, t1);
>
> Should because nothing but the boot sequence touches ntldr. OTOH it is just
> a file, so you can read it if you want.
>
> Avoid a file pick dialog - the default VEE file pick touches the file to
> make sure the selected action (reading or writing) will succeed, so the last
> access time is the time the object executes.
> -SHAWN-
>
---  To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body. To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com". To send messages to this mailing list, email "vrf@agilent.com". If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com". Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".  

Outcomes