January 7th, 2009
As your application grows it can be useful to get an idea of how much memory a particular data structure is using in memory. Measuring memory in a garbage collected environment is a somewhat of a moving target as the Garbage collector is able to move things around in the background.The .NET libraries offer two ways of measuring your applications memory. The total amount of memory allocated to the process (which includes code, unique libraries) and the amount of memory used that the Garbage collector is aware off (which is only your applications variables). This second set is of course a subset of the total amount of memory.
Read the rest of this entry »
Tags: garbage collector, hack, Learn C#, memory usage, object creation, process
Posted in Intermediate, Learn C# | 1 Comment already!»
January 6th, 2009
The .NET C# library provides all the basic elements for encrypting a string with a passphrase and decrypting it later. Doing this however requires a few steps in between. This post show a simple set of routines to help you do just that. We use the TripleDES encryption suite to do the actual encryption, with a little help from the MD5 hash sum generator.
The complete source code is listed below, but lets have a little look at how it works first.
Read the rest of this entry »
Tags: decryption, encryption, Learn C#, md5, strings
Posted in Intermediate, Learn C# | 1 Comment already!»