开发者

Vb.net Read From Console When Using A Windows Form Application

开发者 https://www.devze.com 2023-04-07 15:42 出处:网络
Hi all I have a problem with reading and writing to the console from a windows form application. I am running visual studios 2010 and I am coding in visual basic.

Hi all I have a problem with reading and writing to the console from a windows form application.

I am running visual studios 2010 and I am coding in visual basic.

The current code that I have is as follows:

Declare Function AttachConsole Lib "kernel32.dll" (ByVal dwProcessId As Int32) As Boolean
Declare Function FreeConsole Lib "kernel32.dll" () As Boolean
System.Console.Write("abc")
Dim test as string = Console.ReadLine()
System.Console.Clear()
ect开发者_开发技巧
FreeConsole()

With the following code I can write to the console but I cannot read from it, any ideas?

0

精彩评论

暂无评论...
验证码 换一张
取 消