Posts|Comments

Category Archives: Snippets

Sample code snippets taken from else where or written by me

MSDN code examples could be incorrect as well

It was really odd for me to find an error in MSDN code example which took almost a couple of hours to figure out what is wrong. I am working in VSTO (Visual Studio Tool for Office). I am developing a plugin which is suppose to override some of the specific Office 2007 functionalities and [...]

Microsoft .NET Framework 3.5 SP1 Source Code Released

I would have never known that this takes up these many calls to perform a simple Console.WriteLine operation unless Microsoft had released the source code of the .net framework. I am delighted that the source code for 3.5 sp1 is out. It is time to dive deep in the framework itself.
Find the link below:
http://blogs.msdn.com/rscc/archive/2008/08/28/net-framework-3-5-sp1-sources-are-available.aspx

Generate Random GUID by script

I had a task in hand to read and update a few registry settings. Since the registry keys might change in future and some more changes might be required on the fly, I decided to go with script instead of a config driven executable. Also, one compelling reason was that it has been some time [...]

SharpZipLib Decompression

Very often I require to perform (de)compression of archives programmatically. I use SharpZipLib for this purpose. After fiddling with several algorithms I found this simple piece of code that performs an elegant task of quick decompression of a zip archive.
internal void Decompress(string fileName,string extractPath)
{
FastZip fZip = new FastZip();
fZip.ExtractZip(fileName, extractPath, “”);
}
Link: http://dotnet.org.za/thea/archive/2006/01/17/Unzip-files-programmatically-in-C_2300_-_2D00_-_2300_ZipLib.aspx