how to show console window in Visual Studio( Solved )
I wrote a VB console application,console.writeline () --》 output the result to console window,
but when I run from visual studio,
the console window does show up, however, it disappear quickly.
I got two ways to deal with this problem:
#1 . open cmd window, then go to the project, find the .exe file, run exe file from cmd window.
#2 . in you source code, add Console.ReadKey() before the Console.writeline(), this will pause the console window, wait for user input.
Console.WriteLine(" my book is : " & mybook.name)
Console.ReadKey()
By the way,
if you Debug.writeline(), this will output the result into output window,
( visual studio - > view - > other window - > output )
However, in my case, it doesn't work. I don't know why.
++++++++++++ Source code: ++++++++++++++
Module Module1
Public Class book
Private booknamevalue As String
Public Sub New(ByVal bookname As String)
booknamevalue = bookname
End Sub
Public Property name() As String
Get
Return booknamevalue
End Get
Set(ByVal value As String)
booknamevalue = value
End Set
End Property
End Class
Sub Main()
Dim mybook As book = New book("Textbook")
Console.ReadKey()
Console.WriteLine(" my book is : " & mybook.name)
Console.ReadKey()
Debug.WriteLine(" my book is : " & mybook.name)
End Sub
End Module --------------------编程问答-------------------- Sub Main()
Dim mybook As book = New book("Textbook")
Console.ReadKey()
Console.WriteLine(" my book is : " & mybook.name)
Console.ReadKey()
Debug.WriteLine(" my book is : " & mybook.name)
console.Readline()
End Sub
--------------------编程问答-------------------- 用气无力 --------------------编程问答-------------------- 1 楼正解, JF --------------------编程问答-------------------- yeah, you should add Console.ReadLine() AFTER the Console.writeline() --------------------编程问答-------------------- every answer is ok. use " console.readline() "
get something from console window which is show up/ --------------------编程问答-------------------- the first floor's answer is right
use console.Readline()
--------------------编程问答-------------------- 進來學習,學習英語。
补充:.NET技术 , VB.NET