[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.6

Help....        Must Maintain Directory and Files LastAccessedTime

Asked by BillyDvD in C# Programming Language, .NET, .NET Framework 2.x

Tags: C#

I have to search thru massive directory trees including all files within. I have one issue using the (Directory | DirectoryInfo | DirectoryInfo[] and the File | FileInfo | FileInfo[] )
They all mod the LastAccessedTime !!!! ANd the only property I need happens to this....  So if I look at it today and it was 10/5/1999 right after I look at it, it becomes DateTime.Now !! Grrrrrrr :)

I am probably overlopoking something simplistic but as it stands I need help fast....   Thanks in advance BillyDvd



=========================   SAMPLE CODE ONLY ==========================
class Class1
    {
        MoreMethods DI = new MoreMethods();
        List<FileInfos> ListToCompress = new List<FileInfos>();
        DirectoryInfo RootDir = new DirectoryInfo( Variables.Root );
        DirectoryInfo[ ] ROOT;

        private void BtnGetDirectories_Click( object sender , EventArgs e )
        {
            ListToCompress = new List<FileInfos>();

            ROOT = RootDir.GetDirectories( "*" , SearchOption.TopDirectoryOnly );

            foreach ( DirectoryInfo var in ROOT )
            {
                if ( DI.AddToList( var ) )
                    ListToCompress.Add( new FileInfos( var.FullName , var.LastAccessTime , var ) );
            }

            foreach ( FileInfos var in ListToCompress )
            {
                Console.WriteLine( var.Parent.ToString() + "\t" + var.LastAccessTime.ToString() + "\r\n" );
            }

        }



        /// <summary>
        /// Hold the relevant info for the list items
        /// </summary>
        internal class FileInfos
        {
            public DirectoryInfo Parent;
            public string FullName;
            public DateTime LastAccessedTime;

            /// <summary>
            /// Initializes a new instance of the <see cref="FileInfos"/> class.
            /// </summary>
            /// <param name="FullName">The full name.</param>
            /// <param name="LastAccessedTime">The last accessed time.</param>
            /// <param name="Parent">The parent.</param>
            public FileInfos( string FullName , DateTime LastAccessedTime , DirectoryInfo Parent )
            {
                this.FullName = FullName;
                this.LastAccessedTime = LastAccessedTime;
                this.Parent = Parent;
            }

        }

        internal class MoreMethods
        {
            /// <summary>
            /// Returns True if the item should be added to the list
            /// </summary>
            /// <param name="FileInfoArray"></param>
            /// <returns></returns>
            bool AddToList( FileInfo[ ] FileInfoArray )
            {
                if ( FileInfoArray.Length == 0 )
                    return false;

                List<FileInfo> Addthesefiles = new List<FileInfo>( FileInfoArray );
                //---| Lets see if there are any or all ready to be archived. |---
                Addthesefiles = Addthesefiles.FindAll( IsOlderThan );

                if ( Addthesefiles.Count == FileInfoArray.Length )
                    return true;
                else
                    return false;
            }

            public bool AddToList( DirectoryInfo di )
            {
                DirectoryInfo[ ] da = di.GetDirectories( "*" , SearchOption.AllDirectories );
                if ( da.Length > 0 )
                {
                    foreach ( DirectoryInfo var in da )
                    {
                        if ( !AddToList( var.GetFiles( "*" , SearchOption.AllDirectories ) ) )
                            return false;
                    }
                    return true;
                }

                return AddToList( di.GetFiles( "*" , SearchOption.AllDirectories ) );

            }
        }

    }
[+][-]11/12/07 07:24 PM, ID: 20269305Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/12/07 07:26 PM, ID: 20269314Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/12/07 08:13 PM, ID: 20269481Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/13/07 07:27 AM, ID: 20272108Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/13/07 08:35 AM, ID: 20272762Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/13/07 11:20 AM, ID: 20274179Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/14/07 12:04 PM, ID: 20283220Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/14/07 12:25 PM, ID: 20283427Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/14/07 01:09 PM, ID: 20283863Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/14/07 01:20 PM, ID: 20283973Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/14/07 01:22 PM, ID: 20283999Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/14/07 03:56 PM, ID: 20285164Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/16/07 04:34 AM, ID: 20297680Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/16/07 04:49 AM, ID: 20297738Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/16/07 07:50 AM, ID: 20299093Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/15/07 03:04 AM, ID: 20476910Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]12/17/07 12:34 AM, ID: 20483511Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: C# Programming Language, .NET, .NET Framework 2.x
Tags: C#
Sign Up Now!
Solution Provided By: Jerry_Pang
Participating Experts: 4
Solution Grade: A
 
[+][-]12/17/07 12:40 AM, ID: 20483528Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/22/07 07:45 PM, ID: 20520454Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]01/01/08 07:22 AM, ID: 20560038Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 / EE_QW_2_20070628