Configure IIS SSL host header using a UI

IIS has a feature that allows multiple sites to share the same port, but use different domain names. Unfortunately the IIS UI doesn’t let you do that with HTTPS sites that use SSL certificates. Host name is literally disabled when when you select HTTPS.

This is only a UI limitation and you can actually assign a hosting name using the `appcmd` command line application. But if you are like me you sometimes prefer a UI especially when doing the same thing repeatedly.

So I created IIS Buddy, it mimics the IIS user interface, but unlike the native UI it lets you assign host names to HTTPS SSL sites just as easily as you can assign host names to regular HTTP site.

Download IIS Buddy

Download IIS Buddy for .NET Framework 3.5

Here are some screenshots:

iis-budy-screenshot-1
iis-budy-screenshot-2
iis-budy-screenshot-3

Inline IL in C#

One of the features I liked in C++ was the ability to include inline assembly. Granted I never found much practical use for it but it was a great way to learn assembly without having to write a whole application in it.

Well a very clever Canadian by the name of Roy has now made that possible in C# and VB.NET. Not only is it a great feature but the way he implemented it is very clever and can be applied to do your own IL manipulation of your binaries.

Basically Roy uses the existing Visual Studio tools ildasm and ilasm to decompile your binary into IL, insert your IL code blocks, and recompile the result.

You specify your IL by enclosing it inside an #if directive, like so:

public static int Add(int n, int n2) {
#if IL
    ldarg n
    ldarg n2
    add
    ret
#endif
    return 0; // place holder so method compiles
}

Adding this feature to your project is as simple as adding a post-build step. You can find the whole article here: http://www.codeproject.com/Articles/438868/Inline-MSIL-in-Csharp-VB-NET-and-Generic-Pointers

Invoke base method using reflection

I came across this problem when I was writing a proxy library. I wanted to invoke the method of the base class but was instead invoking the overriden version. I was able to find the answer on Stack Overflow. Here is the code sample of the problem.

class BaseClass {
    public virtual void Test() { 
        Console.WriteLine("Test() from BaseClass"); 
    }
}

class OverridingClass : BaseClass {
    public override void Test() { 
        Console.WriteLine("Test() from OverridingClass"); 
    }
}

public static void Main() {
    var d = new OverridingClass();
    typeof(BaseClass).GetMethod("Test").Invoke(d, null);
}

[Read more…]

Change Windows 7 Logon Screen Wallpaper

windows-7-wallpaper-app

So I wanted to change the wallpaper on my logon screen for Windows 7. I found some great articles online on how to do it. Then I decided to create a quick little app to make easier for me and anyone else to change it in the future.

It works around the limitations of Windows. For example Windows 7 only supports JPEGs, this tool supports many other formats including PNG, BMP, and TIFF.

[Read more…]

Simpler WPF Binding

WPF has a lot of great concepts. One of my favorite is data binding. The syntax though can get pretty tough and you end up having to reference some kind of cheat sheet every time you want to use it. Also you can’t bind directly to methods, instead you have to wrap methods around “commands”.

These limitations really slow you down. Luckily WPF binding is extendable, so I created my own binding which simplified things a lot. Below are some examples an a link to download the source code.

[Read more…]