I blog whenever I C#

Archive for the ‘.NET’ Category

Using Rake in .NET projects

Last year I started using Rake for my .NET build scripts and it has been a quite pleasant experience that I wanted to share with you. “Hmmm, isn’t Rake one of those scary Ruby tools from the other side of the fence?” you might ask. Yes, indeed, it is a Ruby tool! Many good things [...]

Getting the base domain URL from the Uri class

If you’ve used the System.Uri class in .NET you may have stumbled upon the need to extract the base part of the URL and found no obvious solution. You know, you have a URL that looks like this: http://www.mydomain.com/somepath/somepage.aspx?param=x And you want to get only this part: http://www.mydomain.com If you put the long URL in [...]

Preserving transparency when converting icon to bitmap

Recently I wanted to show shell icons in a custom control on a Windows form. The custom control only supported bitmaps so I needed to convert the icons into bitmaps. This is quite easy in .NET since there is a nice Bitmap.FromHIcon() method. The problem is that when you use this method the icon transparency [...]

Follow

Get every new post delivered to your Inbox.