A Wealth of Data through WMI

May 28, 2009

Windows Management Instrumentation (WMI) can provide a wealth of information about various subsystems in Windows. Sometimes it’s the only (reasonable) way to get that information. Although I’ve known WMI for years, since it appeared in Windows 2000, I’ve recently was reminded of its power while preparing to deliver a Windows 7 course. To get a better understanding of WMI and how to use it in managed code to not only consume, but also to provide data and events, read Sasha Goldshtein’s article on CodeProject. As a simple example, suppose we want to write a tool to monitor creation...
tags: ,
4 comments

BigInteger in .NET 4.0

May 26, 2009

One of the simplest new additions to the .NET 4.0 framework is an integer with arbitrary length, System.Numerics.BigInteger. Here’s a simple usage example, comparing it to a double:   BigInteger b = BigInteger.Pow(2, 64); Console.WriteLine("BigInteger: {0}", b.ToString("N")); Console.WriteLine("Double:     {0}", Math.Pow(2, 64).ToString("N")); Console.WriteLine(); b = BigInteger.Pow(2, 128); Console.WriteLine("BigInteger: {0}", b.ToString("N")); Console.WriteLine("Double:     {0}", ((double)b).ToString("N")); The output is: Not bad.
no comments