Posts Tagged ‘C#’

Casting Enums by using Extension Methods in C#.

Wednesday, June 23, 2010 8:39 No Comments

In C# there is no way to implicity cast one enum to another. One possible way around this is by assigning values to each enum member. If the values of the first enum match the values of the second enum, you use two casts; the first casting the first enum value to an integer, and [...]

This was posted under category: Uncategorized Tags: , , ,

HOW TO: Use a Custom Membership Provider, Custom Membership User and Role-Provider with a WCF Service hosted inside a Windows Service.

Friday, August 14, 2009 12:19 No Comments

I have written a small HOW TO on how to use a Customer Membership Provider, a Custom Role-Provider and a Custom Membership User for username/password authentication in a WCF Service that is hosted in a Windows Service. The HOW TO includes a sample implementation of these providers. It also includes a complete Visual Studio Project [...]

This was posted under category: Web, Windows, Windows Server 2003, Windows Server 2008, Windows Vista, Windows XP Tags: , , , , , ,

Prevent starting multiple instances of a Windows Forms application.

Thursday, October 30, 2008 11:52 No Comments

There are situations where you do not want a user to start multiple instances of the same Windows Forms application more then once. There are solutions for this out there, that require writing some file and locking it (sort of File Share Witness thingy) and solution that check the running processes on the machine. (What [...]

This was posted under category: Windows Tags: , , ,