• <bdo id='qPOwh'></bdo><ul id='qPOwh'></ul>
  1. <legend id='qPOwh'><style id='qPOwh'><dir id='qPOwh'><q id='qPOwh'></q></dir></style></legend>
  2. <tfoot id='qPOwh'></tfoot>

      <small id='qPOwh'></small><noframes id='qPOwh'>

      <i id='qPOwh'><tr id='qPOwh'><dt id='qPOwh'><q id='qPOwh'><span id='qPOwh'><b id='qPOwh'><form id='qPOwh'><ins id='qPOwh'></ins><ul id='qPOwh'></ul><sub id='qPOwh'></sub></form><legend id='qPOwh'></legend><bdo id='qPOwh'><pre id='qPOwh'><center id='qPOwh'></center></pre></bdo></b><th id='qPOwh'></th></span></q></dt></tr></i><div id='qPOwh'><tfoot id='qPOwh'></tfoot><dl id='qPOwh'><fieldset id='qPOwh'></fieldset></dl></div>
    1. 使用 AttachConsole,用户必须按 Enter 才能获得常规

      时间:2023-08-27
          <tbody id='gjOy0'></tbody>
        • <bdo id='gjOy0'></bdo><ul id='gjOy0'></ul>
          • <legend id='gjOy0'><style id='gjOy0'><dir id='gjOy0'><q id='gjOy0'></q></dir></style></legend>

            <small id='gjOy0'></small><noframes id='gjOy0'>

            1. <i id='gjOy0'><tr id='gjOy0'><dt id='gjOy0'><q id='gjOy0'><span id='gjOy0'><b id='gjOy0'><form id='gjOy0'><ins id='gjOy0'></ins><ul id='gjOy0'></ul><sub id='gjOy0'></sub></form><legend id='gjOy0'></legend><bdo id='gjOy0'><pre id='gjOy0'><center id='gjOy0'></center></pre></bdo></b><th id='gjOy0'></th></span></q></dt></tr></i><div id='gjOy0'><tfoot id='gjOy0'></tfoot><dl id='gjOy0'><fieldset id='gjOy0'></fieldset></dl></div>
              <tfoot id='gjOy0'></tfoot>
              1. 本文介绍了使用 AttachConsole,用户必须按 Enter 才能获得常规命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我有一个程序,既可以作为 winform 运行,也可以从命令行运行.如果它是从命令行调用的,我会调用 AttachConsole(-1) 来附加到父控制台.

                I have a progaram that can be ran both as a winform, or from command line. If it is invoked from a command line I call AttachConsole(-1) to attach to parent console.

                但是,在我的程序结束后,用户必须按回车键才能返回标准命令提示符(c:>").有没有办法避免这种需要?

                However, after my program ends, the user must hit enter to get back the standard command prompt ("c:>"). is there a way to avoid that need?

                谢谢.我可以将它包装在一个 cmd 文件中以避免该问题,但我想从我的 exe 中完成.

                Thanks. I could wrap it in a cmd file to avoid that issue, but I would like to do it from my exe.

                推荐答案

                尝试在你的 exe 退出前添加这一行...

                Try adding this line just before your exe exits...

                System.Windows.Forms.SendKeys.SendWait("{ENTER}");
                

                有点小技巧,但是当我遇到这个问题时,我能找到最好的方法.

                Bit of a hack, but best I could find when I encountered that problem.

                这篇关于使用 AttachConsole,用户必须按 Enter 才能获得常规命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何从 WPF 应用程序写入命令行? 下一篇:系统托盘中的 .Net 控制台应用程序

                相关文章

                最新文章

              2. <small id='HCnV4'></small><noframes id='HCnV4'>

                  <i id='HCnV4'><tr id='HCnV4'><dt id='HCnV4'><q id='HCnV4'><span id='HCnV4'><b id='HCnV4'><form id='HCnV4'><ins id='HCnV4'></ins><ul id='HCnV4'></ul><sub id='HCnV4'></sub></form><legend id='HCnV4'></legend><bdo id='HCnV4'><pre id='HCnV4'><center id='HCnV4'></center></pre></bdo></b><th id='HCnV4'></th></span></q></dt></tr></i><div id='HCnV4'><tfoot id='HCnV4'></tfoot><dl id='HCnV4'><fieldset id='HCnV4'></fieldset></dl></div>
                1. <tfoot id='HCnV4'></tfoot>

                  <legend id='HCnV4'><style id='HCnV4'><dir id='HCnV4'><q id='HCnV4'></q></dir></style></legend>

                  • <bdo id='HCnV4'></bdo><ul id='HCnV4'></ul>