Comments on the Enterprise Library Logging Block/Log4Net feature and performance comparison

A lot of people have heard about the discussion between log4net and the Enterprise Library Logging Block.

The Enterprise Library Product Manager, Tom Hollander, has posted a write-up .

Go take a look.

Invoking the Microsoft Log Parser COM Interface from managed code ( C# )

This will create an XML file that has your url’s that are refered to, hit count, and the referrer.

try
{
    Type comLogQueryType = 
        Type.GetTypeFromProgID("MSUtil.LogQuery", true);
    object comLogQueryObject = 
        Activator.CreateInstance(comLogQueryType);
 
    // Get the IIS Input and XML output filters
    Type ws3LogType = 
        Type.GetTypeFromProgID("MSUtil.LogQuery.IISW3CInputFormat", true);
    object ws3LogObject = 
        Activator.CreateInstance(ws3LogType);
    Type xmlLogType = 
        Type.GetTypeFromProgID("MSUtil.LogQuery.XMLOutputFormat", true);
    object xmlLogObject = 
        Activator.CreateInstance(xmlLogType);
 
    // Setup input and output files
    string inPath = "someIISlog.log";
    string outpath = "temp.xml";
 
    // Create a SQL query to get the referers, count and uri-to. Order by total hits
    string query = 
        "SELECT cs(Referer) as Referer,cs-uri-stem as To,COUNT(*) as Total from " +
        inPath + " TO " + outpath +
        " WHERE (sc-status=200) AND (Referer LIKE 'http:%') GROUP BY Referer,To ORDER BY Total DESC";
 
    // Invoke the ExcuteBatch method
    object[] inputArgs = {query, ws3LogObject, xmlLogObject};
    comLogQueryType.InvokeMember("ExecuteBatch", BindingFlags.InvokeMethod, 
        null, comLogQueryObject, inputArgs);
}
catch (Exception e)
{
    string errorString = "An exception has occurred: " + e.Message;
    Console.WriteLine(errorString);
}
 
[Via Steve Makofsky ]
 

Freeware Disk Defragmenter

It works with any OS-supported file system* on any OS-supported writable media. It will only work on Windows XP and Windows Server 2003. This program will not work on any other line of Windows (9x, Win 3.1, etc).

Features:

  • Can be run by any user (service needs to be installed by an administrator).
  • Complete whole-disk defragging, including private operating system files.
  • Multiple instances can be run simultaneously (if you have multiple disks).
  • Individual file defragging, with wildcards and recursion. This mode is an opportunistic defragger, marginally better than Diskeeper in that it will at least defrag the file as best it can rather than not at all.
  • Defrags NTFS, FAT** and FAT32** filesystems on any media (HD, ZipTM/JazTM, Floppy, etc).
  • A "shotgun" mode, where it severely fragments files. Useful for testing or really annoying someone.
  • Individual file fragmentation analysis. Find out where on disk a file resides, and how many fragments it’s in.
  • 100% safe and interruptable. This program doesn’t actually move the files - the OS does it. Even if you suffer a power failure while it’s working, you run no higher risk of file system corruption than you would if you had happened to be saving a file from any application.
  • Boot-time defragmentation.

Download Disk Defragmenter

.Text to CommunityServer converter

The tool is a GUI wizard that can be run on any machine. You do not need to have Community Server installed on the same box. Your .Text and CS installations can be on the same or different SQL servers. However you will need to have the ability to connect directly to your SQL Server(s) over the Internet from the machine this utility is being run on.

It converts users, weblogs, posts, articles, comments, trackbacks, referrals, view counts, links, and categories. The only kind of .Text content it does NOT convert is .Text photo galleries.

Download

[ Via Kevin Harder's blog ]

Effective .NET Framework based development: Exception handing and Memory Management

Check out Brad’s slides on structured exception handling and memory management that he just published on his blog.

"This downloadable presentation is an overview of best practices and issues with the usage of exceptions, and different issues surrounding memory management including the IDisposable pattern, finalizers, memory pressure, HandleCollector, and why the using statement (Using in VB) is your friend! It’s an excellent overview of some fundamental exception and memory management topics."

CLR Exception and Memory Management

You can also check out more elaborate documentation ( .NET Framework Resource Management ) of the recommended guidelines for IDisposable and finalizers.

[ Via rgabostyle.com ]


Page 46 of 59« First...102030...4445464748...Last »