TIPS: VB.NET: Obtaining Password from Console


Console.Write(“Kindly enter the password:”)
Dim info As ConsoleKeyInfo
Do
info = Console.ReadKey(True)
If info.Key = ConsoleKey.Enter Then
Exit Do
Else
sPassword &= info.KeyChar
If info.KeyChar vbBack Then
Console.Write(“*”)
Else
Console.Write(vbBack & ” ” & vbBack)
End If
End If
Loop