PC Review


Reply
Thread Tools Rate Thread

Any way to clear old log files

 
 
Paul
Guest
Posts: n/a
 
      13th Aug 2008
Hi I have a console application C# VS2005 that runs remotely and creates a
timestamped log file each time it runs (nightly). I was just wondering if
there is a way to delete only files that are more than 30 days old?
Thanks.
--
Paul G
Software engineer.
 
Reply With Quote
 
 
 
 
Paul
Guest
Posts: n/a
 
      13th Aug 2008
Thanks it worked!
--
Paul G
Software engineer.


"Mark Rae [MVP]" wrote:

> "Paul" <(E-Mail Removed)> wrote in message
> news:74DC4548-C159-45B3-BE7A-(E-Mail Removed)...
>
> > Hi I have a console application C# VS2005 that runs remotely and creates a
> > timestamped log file each time it runs (nightly). I was just wondering if
> > there is a way to delete only files that are more than 30 days old?

>
> Point the GetFiles method of the DirectoryInfo class at the folder where the
> log files are stored.
>
> Read each file into a FileInfo object and inspect its LastWriteTime
> property.
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to clear temp ie files =?Utf-8?B?SUtF?= Windows XP Customization 3 10th Oct 2006 06:20 AM
how to clear Read only files? =?Utf-8?B?UXVlc3Rpb24/Pw==?= Microsoft Word Document Management 1 16th Oct 2004 12:01 AM
Can Not Clear Temporary Files Gabe Microsoft Outlook 2 17th Jun 2004 03:47 PM
no tab to clear temporary internet files, clear history Ron Hein Windows XP Internet Explorer 1 9th Sep 2003 09:45 PM
no tab to clear temporary internet files, clear history Ron Hein Windows XP General 0 9th Sep 2003 08:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:27 PM.