Creating a comma separated list from IList or IEnumerable

.NET 4+ Detail & Pre .Net 4.0 Solutions IEnumerable<string> can be converted into a string array very easily with LINQ (.NET 3.5): It’s easy enough to write the equivalent helper method if you need to: Then call it like this: You can then call string.Join. Of course, you don’t have to use a helper method: The latter is a bit of … Read more

How to get correct timestamp in C#

Your mistake is using new DateTime(), which returns January 1, 0001 at 00:00:00.000 instead of current date and time. The correct syntax to get current date and time is DateTime.Now, so change this: to this:

.NET graph library around?

Use a combination of QuickGraph (GitHub, CodePlex) and Graph# for WPF (GitHub fork, CodePlex) – both top notch libraries. They work really well for me but the documentation for Graph# is almost non-existant.

Padding is invalid and cannot be removed?

Rijndael/AES is a block cypher. It encrypts data in 128 bit (16 character) blocks. Cryptographic padding is used to make sure that the last block of the message is always the correct size. Your decryption method is expecting whatever its default padding is, and is not finding it. As @NetSquirrel says, you need to explicitly … Read more