我怎样才能让我的控制台 window 打开? VB
How can i let my console window open? VB
我想让我的控制台 window 在 Visual Basic 中打开。使用我拥有的代码,我只能请求一行,然后 window 关闭。这是我的代码:
Module Module1
Sub Main()
If (Console.ReadLine = "e") Then
Console.WriteLine("Test")
End If
Console.ReadKey()
End Sub
End Module
所以当我 运行 这个代码时,我可以输入 "e" 按回车键。单词出现 "Test" 然后按一个键后控制台关闭。但是我想让它打开,直到我写了一个特殊的词。
这是一个愚蠢的例子:
Sub Main()
Dim password As String = "007"
Dim response As String
Do
Console.Write("Password: ")
response = Console.ReadLine
If response <> password Then
Console.WriteLine("Incorrect Password!")
End If
Loop While response <> password
Console.WriteLine("Welcome James Bond!")
Console.Write("Press [Enter] to proceed...")
Console.ReadLine()
End Sub
我想让我的控制台 window 在 Visual Basic 中打开。使用我拥有的代码,我只能请求一行,然后 window 关闭。这是我的代码:
Module Module1
Sub Main()
If (Console.ReadLine = "e") Then
Console.WriteLine("Test")
End If
Console.ReadKey()
End Sub
End Module
所以当我 运行 这个代码时,我可以输入 "e" 按回车键。单词出现 "Test" 然后按一个键后控制台关闭。但是我想让它打开,直到我写了一个特殊的词。
这是一个愚蠢的例子:
Sub Main()
Dim password As String = "007"
Dim response As String
Do
Console.Write("Password: ")
response = Console.ReadLine
If response <> password Then
Console.WriteLine("Incorrect Password!")
End If
Loop While response <> password
Console.WriteLine("Welcome James Bond!")
Console.Write("Press [Enter] to proceed...")
Console.ReadLine()
End Sub