当我将父 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.