Tag Archives: .NET

Write to file from multiple threads async with C# and .NET Core

There are several patterns on how to allow multiple threads to write to the same file. the ReaderWriterLock class is invented for this purpose. Another classic is using semaphors and the lock statement to lock a shared resource. This article … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , | 6 Comments

Change date format using .NET Regular Expressions

You can use Regex.Replace to change the format of a date string. For example if your input string is YYYY/MM/DD but you need to change it to YYYY-MM-DD, you can use this small method: Regular expressions are unreadable as usual, … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , | 1 Comment

Your session ID is being reused and there is nothing you can do about it

In many years we have been used to the fact that the ASP.Net session ID uniquely identifies one session, and one session only. Back in 2006, Margaret Rouse from TechTarget even wrote in the definition of a session ID that: … Continue reading

Posted in .net, General .NET | Tagged , , , | 4 Comments

Validate CheckBoxList using a CustomValidator

In this article I explain how you can validate that at least one checkbox is checked in an asp:CheckBoxList using an asp:CustomValidator, and how to make it work server side and client side. None of the built in .net validators … Continue reading

Posted in .net, c#, General .NET | Tagged , , , , , , , , | 6 Comments