使用 Windows 窗体应用程序时 Vb.net 从控制台读取
大家好,我在从 Windows 窗体应用程序读取和写入控制台时遇到问题。
我正在运行 Visual Studio 2010,并使用 Visual Basic 进行编码。
我当前的代码如下:
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()
使用以下代码,我可以写入控制台,但无法从中读取,有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论