><(({°>

archives
it happens mostly at night
26 February, 2009
# console username and password
forgive me for using vb.net, but here's a quick and dirty way to get a nice login with password masking (the latter being the point of this post)

Sub Main()

Dim strU As String
Dim strP As String
Console.Write("Username: ")
strU = Console.ReadLine()
Console.Write("Password: ")
Dim strPkey As ConsoleKeyInfo
Do
strPkey = Console.ReadKey(True)
If strPkey.Key <> ConsoleKey.Enter Then
strP = strP & strPkey.KeyChar.ToString
Console.Write("*")
Else
Exit Do
End If
Loop

End Sub
sounddoc
Comments:

Post a Comment (0) comments