Guten Tag,
folgendes Problem, ich hab hier nen CodeSnippet bekommen.
Wie kann ich ne InputBox ins formular einfügen und mit der funktion auswerten lassen?
folgendes Problem, ich hab hier nen CodeSnippet bekommen.
Wie kann ich ne InputBox ins formular einfügen und mit der funktion auswerten lassen?
VB.NET-Quellcode
- Imports System.Security.Cryptography
- Public Class Form1
- Public Function Convert_PlainTextAuthToShaAuth(ByVal sAuth As String) As String
- Dim sPassword As String() = sAuth.Split(New Char() {":"c}) ' Extract the pass
- Return sPassword(0) & ":{SHA}" + Convert.ToBase64String(Create_Sha1Hash(System.Text.Encoding.ASCII.GetBytes(sPassword(1))))
- End Function
- Public Function Create_Sha1Hash(ByVal byInput As Byte()) As Byte()
- Dim sha1 As SHA1 = New SHA1CryptoServiceProvider()
- Return sha1.ComputeHash(byInput)
- End Function
- End Class