C#: Create a single instance application

blog — Tags: , — anon @ 10/01 11:41 am

Under certain circumstances you may want to allow only one instance of your applications. How do I do that in C#? Well, it is fairly easy. Start by creating a Windows Forms Application.

Include the following Namespace:

using System.Runtime.InteropServices;

Just wrap the following code around the Application.Run() call and there you go:

Process[] runningProcesses = Process.GetProcessesByName("Project1");
if (runningProcesses.Length == 1)
{
    Application.Run(new Form1());
}

Free Subversion Repositories

blog — Tags: , , — anon @ 10/01 1:39 pm

I was looking for a free (yea, completely free) Subversion Repository where I can store my stuff but not having it published somewhere which is one of the reasons I didn’t want to use Google Code either. You may want to try www.freesubversion.com. Go for it and create a Repository on the fly. File access performance is okay so far. But hey, it’s free. I wonder why I haven’t found that one before.

copyright © 2008-2010 datenkompost.de/blog - barecity derivative | imprint
* a title remix inspired by a popular german book