How to Get the Name of an Object’s Type (Class) in C#

string name = instanceVariable.GetType().Name;

“Indexed Properties” of a Class in C#

In Jabber-net library, which I am using for my client, I saw this piece of code, which basically stores an array of type-unsafe properties. It is a useful idiom to have in mind for C# developers.

/// <summary>

/// Sets or retrieves a connection property.

/// You have to know the type of the property based on the [...]

XML Configuration File for .Net Projects

ConfigurationManager class is used to load settings from an XML file at the start of an application. Usually people edit it outside the application (manually with a text editor), however, it is possible to change configuration inside the program:

http://blog.sb2.fr/post/2008/11/29/HowTo-Modify-Configuration-File-Programmatically-with-C.aspx

The Jabber-Net library uses this function to update its configuration file instead:

/// <summary>

/// Write the current connection [...]