Home

Strong password storage strategies on websites

We are regularly asked when registering for a website to make sure that we use a secure password, over a certain number of characters, different character sets etc. but once we have submitted our password how do we know that their password storage strategy is adequate? Yesterday I realised that I had forgotten my password for a web hosting serv...

Read more

TSQL get date difference as string

I found myself recently needing to be able to present the user with the difference between two dates as a string, unfortunately the data had to come straight from SQL Server into the application that they was using ready to be displayed. After spending quite some time looking around the Internet to try and find a TSQL function that would work, I...

Read more

Installed Excel versions and location

Microsoft Excel is probably one of the most used pieces of software on the planet. Spreadsheets are used heavily throughout the business world and Microsoft have enjoyed their Office suite taking a large proportion of businesses There was a question recently on Stack Overflow which I felt was a challenge to answer as I couldn’t find anywhere ...

Read more

Randomise a List

This is one of the reasons why I love LINQ, its so easy to do something like randomise a list in just one line that used to take a few lines. The only thing you need to remember with this code is that you need to have specified that you’re using System.Linq in order for it to work. List myCollection = new List(); myCollection = myCollection.O...

Read more

Get the associated application for a file extension

Sometimes its necessary for us to identify what application is associated with a particular file extension, the following snippet of code will read the Windows registry to identify what application a particular file extension is opened with by default. ''' <summary> ''' This method deals with getting the path of the application that is sp...

Read more

Getting an applications Icon

This is one of those pieces of code that you spend ages trying to find/figure out but once you do get it, it is annoyingly simple. I recently needed to get the Icon that was being used as the application so that it could be used within the application consistently, this is the code that I used in order to achieve this. Icon.ExtractAssociatedIco...

Read more

Shuffle a string in VB.Net

In this tutorial/code example I’m going to show you a method to shuffle the contents of a string. You might use this for something like an anagram game. Private ran As New Random Private Function randomizeString(ByVal input As String) As String Dim rtn As String = "" Dim i As Integer While input.Length > 0 i = ran.Next(0, input.Length)...

Read more

How to find out current class/method name

In this short code example I’m going to show you a method to identify what class (including the namespace) you’re currently in and what the name of the current method is. You can also use this technique to find out more information about the method but I won’t go into that detail here. System.Reflection.MethodBase.GetCurrentMethod().ReflectedTy...

Read more