Click here to Skip to main content
15,884,629 members
Articles / Web Development / ASP.NET

Checksum Verification

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
22 Sep 2011CPOL3 min read 52.2K   1.4K   17  
Loop through all files in a folder/subfolders and run a checksum that is stored in a database. E-mail descrepancies and results.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ChecksumFiles.Utilities
{
    class Logger
    {

        public static void LogMessage(string logMessage, TextWriter w)
        {
            w.Write("\r\nLog Entry : ");
            w.WriteLine("{0} {1}", DateTime.Now.ToLongTimeString(),
                DateTime.Now.ToLongDateString());
            w.WriteLine("  :");
            w.WriteLine("  :{0}", logMessage);
            w.WriteLine("-------------------------------");
            // Update the underlying file.
            w.Flush();
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Database Developer
United States United States
I am an MBA with a bunch of MS certifications. Technically, I am a DBA, but I do a good deal of sys admin work and web development using .NET. I like to focus on business intelligence, database design, messaging architectures, and web services.

Comments and Discussions