Topic on Extension talk:QISSingleSignOn

DotNet VB Code to generate a URL

1
212.91.225.218 (talkcontribs)

Private Function GenerateWikiURL(domain As String, version As String, service As String, username As String, subpage As String) As String

        Dim qqa As System.Security.Cryptography.MD5 = System.Security.Cryptography.MD5.Create

        Dim secret As String = "kahC1oo3pieg6FaekEhou1aipEivae4fe"

        Dim preURL As String = String.Format("{0}/{1}/{2}/{3}/", version, CInt(DateTime.UtcNow.Subtract(New DateTime(1970, 1, 1)).TotalSeconds).ToString, service, username)

        Dim data As Byte() = qqa.ComputeHash(System.Text.Encoding.UTF8.GetBytes(preURL & secret))

        Dim sBuilder As New Text.StringBuilder()

        For i As Integer = 0 To data.Length - 1

            sBuilder.Append(data(i).ToString("x2"))

        Next

        Return String.Format("{0}/{1}?qisssotoken={2}", domain, subpage, preURL & sBuilder.ToString)

    End Function

Reply to "DotNet VB Code to generate a URL"