Wednesday, October 18, 2006

Don't Underestimate The Power Of The Alt Key

Recently, whilst doing a menacing cut and paste job, I remembered the convenience of using the Alt key when selecting text.

Take the following text, for example:

Fruit                   Crisps
=====                ======       
Strawberries        Salt And Vinegar
Apples                Cheese And Onion
Pears                  Ready Salted
Oranges              Chicken
Pineapples          Prawn Cocktail

Now, if I only want to grab hold of whatever is underneath the heading 'Crisps' then all I need to do is hold down my Alt key, hover over the area just left of the letter C and begin dragging across and down. This will select only that portion of text and will exclude whatever lies under the heading 'Fruit'.

Note that only certain programs support the use of this style of copying and pasting. So far I've successfully employed its use in both Visual Studio (2003 & 2005) and SQL Server (2000 & 2005).

Wednesday, October 04, 2006

How To Kill A Process That Just Won't Die


Recently when developing a Windows service, I had problems terminating something through the admin GUI. There is, fortunately though, a manual way of getting your way, via the command line.

Enum Parsing

I always seem to forget how to parse an enum, so here's the code for doing it in 2.0:

enum ConfigurationType
        {
            Internal,
            WebConfigXml,
            Win32Xml
        };

string strConfigType = System.Configuration.ConfigurationSettings.AppSettings["ConfigurationType"].ToString();
ConfigurationType configType = (ConfigurationType)Enum.Parse(typeof(ConfigurationType), strConfigType);

Fixes to common .NET problems, as well as information on .NET features and solutions to common problems that are not language-specific.

Fixes to common .NET problems, as well as information on .NET features and solutions to common problems that are not language-specific.

Z