Feb 15

Turns out that it’s really easy to create add-ins for BlogEngine.NET!  I’ve created a new widget for the site that loads the latest image from ICanHasCheezburger.com, and if you click on the image, it loads the actual page for that entry in to a new window.  You can check it out by locating the bottom widget on the right side of the site. More...

Jan 20

So I just installed the Windows Live Writer, which allows you to create and publish blog postings from the program.  What makes it much nicer than doing it on the actual site is that the application supports plug-ins.

For instance, the one that I really wanted that started me down this path was the Syntax Highlighter plug-in, which takes source code that you paste in to it, and formats it nicely for the blog.  Here’s a simple Hello World example to show off what it can do:

#region Using Directives
using System;
#endregion

namespace TestApp
{
	public static class App
	{
		[STAThread]
		public static void Main()
		{
			Console.WriteLine("Hello World!");
		}
	}
}

I intend to spend some time learning what Live Writer can do for me, as well as what Windows Live has to offer.  So far, I’m impressed.  I’ll record my learning here.

Tags:
Jan 15

In creating a custom NAnt task for a deployment project I've written at work, I needed to gain access to our deployment web server to reset the default web site.  The sample I had that worked was a .vbs file, and I wanted to convert it to C#.  True, I could have worked with System.DirectoryServices and System.Management, and gone through WMI, but I couldn't quite get the security to work (I'm somewhat of a virgin on those 2 namespaces, so I'm sure it could've been done, but being on a timeline, and having a working example, I went with the .vbs code).

So the question, then, was "Is there a C# alternative to GetObject"?  Could I have imported Microsoft.VisualBasic?  Of course.  But I really wanted to find the C# equivelant, for future reference if nothing else.  Enter .NET Reflector.  2 minutes inside the application, and I found the answer.  Marshal.BindToMoniker.  It's called like so:

  • object w3svc = Marshal.BindToMoniker(String.Format("IIS://{0}/w3svc", _Server));
Enjoy the result of my labor.
Tags: | | |