【发布时间】:2016-10-12 00:50:40
【问题描述】:
当我将父 CMD 附加到我的应用程序时,使用 Freeconsole 释放附加的 CMD 后,CMD 中有一个空行,我可以在其中写...就像一个“@ Echo OFF”,当我按“ENTER”时返回回声(@Echo ON)。
http://img607.imageshack.us/img607/566/captura1em.png
这是一个VB代码举个例子:
Private Sub Parse_Arguments()
AttachConsole(-1)
For I As Integer = 0 To My.Application.CommandLineArgs.Count - 1
If My.Application.CommandLineArgs.Item(I) = "/?" Then
Dim Logo As String = <a><![CDATA[Blah blah blah...]]></a>.Value
Console.WriteLine(Logo)
FreeConsole()
End
End If
Next
end sub
我希望你知道我想说什么,我需要 CMD 完全详细,我的意思是我希望 CMD 打印最后一行“C:\Visual Studio Projects\Aero Switcher\ Aero Switch\bin\Debug>" 释放附加的 CMD 时(当我的程序完成执行时),而不是打印没有“echo”的空行。
另一个例子:
这就是我想要的:
C:\>Process.exe
C:\>Text wrote from the process and process finished
c:\>Verbose CMD line, "c:\>" is shown, @Echo is ON, all good!.
这是我得到的:
C:\>Process.exe
C:\>Text wrote from the process and process finished
Damn empty line where I can write commands, not verbose line, @Echo is OFF.
C:\>Verbose CMD line.
【问题讨论】:
-
您是否尝试过将应用程序的链接目标更改为控制台应用程序?这应该为您提供完美的控制台集成,但不会阻止您打开窗口。
标签: c# .net vb.net command-line cmd