randomposts

MSP Accounts Plugin for Labtech RMM Software

posted Dec 9, 2015, 6:18 AM by Steven Barnes

Just to give you an idea of what I've been up to lately.  Here's something I created, MSP Accounts Plugin, using VB.Net and the Labtech SDK.

Complex Password Generator in VB.Net

posted Oct 6, 2015, 1:10 PM by Steven Barnes   [ updated Aug 12, 2016, 11:44 AM ]

I couldn't find a good Complex Password Generator in VB.Net so I wrote my own.

    Private Function randomPassword(passedLength As Integer)
        Dim myLowercase As String = "abcdefghijklmnopqrstuvwxyz"
        Dim myUppercase As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        Dim myNumbers As String = "0123456789"
        Dim mySymbols As String = "~!@#$^*()_-+={}[]:;<>,.?/"
        Dim myAllChars As String = myLowercase & myUppercase & myNumbers & mySymbols
        Dim myRandom As New System.Random
        Dim myPassword As String = ""
        myPassword = myPassword & myLowercase(myRandom.Next(0, myLowercase.Length)) & myLowercase(myRandom.Next(0, myLowercase.Length))
        myPassword = myPassword & myUppercase(myRandom.Next(0, myUppercase.Length)) & myUppercase(myRandom.Next(0, myUppercase.Length))
        myPassword = myPassword & myNumbers(myRandom.Next(0, myNumbers.Length)) & myNumbers(myRandom.Next(0, myNumbers.Length))
        myPassword = myPassword & mySymbols(myRandom.Next(0, mySymbols.Length)) & mySymbols(myRandom.Next(0, mySymbols.Length))
        For i As Integer = 0 To (passedLength - 9)
            myPassword = myPassword & myAllChars(myRandom.Next(0, myAllChars.Length))
        Next
        Dim strInput As String = myPassword
        Dim strOutput As String = ""
        Dim rand As New System.Random
        Dim intPlace As Integer
        While strInput.Length > 0
            intPlace = rand.Next(0, strInput.Length)
            strOutput += strInput.Substring(intPlace, 1)
            strInput = strInput.Remove(intPlace, 1)
        End While
        myPassword = strOutput
        Return myPassword
    End Function

1-2 of 2