Format after BitLocker.

So yesterday I reinstalled my laptop because some beta driver was acting up, no big deal. I had both of my partitions secured with Bitlocker (and a BIOS password set up) so that my laptop is secure.

After formatting I noticed that my C drive wasn’t encrypted anymore (which is obvious, it was formatted).

But my D drive looked like this:

locked

It was locked. Fortunately I printed my recovery key so I was able to unlock the drive.

Please print the keys, and keep them safe!

C#: Smaller syntax for event handlers.

Using lambda functions you can shorten your event handlers.

E.g.:

With a normal event hander:

class Test
{
	private Timer timer;

	private void Timer_Elapsed(object sender, ElapsedEventArgs e)
	{
		Console.WriteLine(string.Format("Object: {0} sends: {1}", sender, e));
	}

       public Test()
	{
		this.timer = new Timer();

		this.timer.Elapsed += new ElapsedEventHandler(this.Timer_Elapsed);

		this.timer.Interval = 100;
		this.timer.Start();
	}
}

With an anonymous function:

class Test
{
	private Timer timer;

        public Test()
	{
		this.timer = new Timer();

		this.timer.Elapsed += delegate(object sender, ElapsedEventArgs e)
					 {
						 Console.WriteLine(string.Format("Object: {0} sends: {1}", sender, e));
					 };

		this.timer.Interval = 100;
		this.timer.Start();
	}
}

And with an anonymous lamba:

class Test
{
	private Timer timer;

        public Test()
	{
		this.timer = new Timer();

		this.timer.Elapsed += (sender, e) => Console.WriteLine(string.Format("Object: {0} sends: {1}", sender, e));
		//or you can explicitly type your parameters:
		this.timer.Elapsed += (object sender, ElapsedEventArgs e) => Console.WriteLine(string.Format("Object: {0} sends: {1}", sender, e));

		this.timer.Interval = 100;
		this.timer.Start();
	}
}

And with a named lamda:

class Test
{
	private ElapsedEventHandler elapsedEventHander;
        private Timer timer;

        public Test()
	{
		this.timer = new Timer();

		this.elapsedEventHander = (sender, e) => Console.WriteLine(string.Format("Object: {0} sends: {1}", sender, e));

		this.timer.Elapsed += this.elapsedEventHander;

		this.timer.Interval = 100;
		this.timer.Start();
	}
}

Which one to take? The one that suits you and your current application / case!

Sidenote: sorry for the layout, I will fix it ASAP. Fixed 🙂

MSDN downloading on Vista

Let’s say you are one of the gifted persons to have MSDN access.

Let’s say you use Vista 64-bit (I don’t know if the problem occurs on 32-bit).

Let’s say you want to download something from MSDN with Microsoft File Transfer Manager.

And it does not work.

Well use this workaround:

First: download the File Transfer Manager from here.

Download and install the MSI. The default path is c:\Program Files (x86)\Microsoft File Transfer Manager”. Remember this.

Then use Firefox to go to the MSDN website, start a download, and it will prompt you to do something with the default.aspx. Well open that file with the File Transfer Manager. And it works!

Woei!

AVG 8 update marks user32.dll as False Positive on XP SP2

DO NOT REMOVE user32.dll, even though AVG 8 states that there is a virus in the file.

Doing so will remove the file, and cause a BSOD, and makes your system unable to boot.

It marks the file as infected with Trojan Horse PSW.BANKER4.APSA.

Possibilities are to wait for an update from AVG, or (preferably) upgrade to XP SP3!