我可以将Windows应用程序转换为控制台应用程序吗 [英] Can I convert a Windows App to a Console App

查看:103
本文介绍了我可以将Windows应用程序转换为控制台应用程序吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种形式的Windows应用程序代码,是否可以不使用任何形式将其转换为控制台应用程序?如果是这样,您如何?
谢谢
DS

I have code for a windows app with one form, Can I convert this to a console app using no forms? If so, yhen how?
Thanks
DS

推荐答案

当然可以.您将需要用基于控制台的UI替换UI.因此,您在屏幕上显示的所有信息都必须写入控制台.并且所有形式的输入也将来自控制台.由于GUI和控制台应用程序之间的输入/输出模型不同,因此应用程序的核心流程也可能会有所变化.

据我所知,目前还没有自动转换工具.
Of course you can. You would need to replace the UI with a console based UI. So any info you have on screen would have to be written to the console. And all forms of input would also come from the console. The core flow of the app may also change a bit because of the different input/output models between GUI and console apps.

There is no automatic conversion tool though as far as I know.


只需尝试使用google
^ ]
Just try google for this
convert a Windows App to a Console App[^]


您可以更改项目设置,以创建控制台应用程序而不是Windows应用程序(只需点击在解决方案窗口中的项目上,按Ctrl + Enter,然后进行更改).

这会将应用程序编译为控制台应用程序,您将获得一个控制台.但是,您仍然可以获取表格.如果您不想使用Windows窗体,则需要删除这些窗体,并用命令行参数或配置替换其功能.然后,您可以删除Windows窗体引用,它将被转换.
我已经从
复制了它 http://stackoverflow.com/a/3427089 [此处]
You can change the project settings to create a Console Application instead of a Windows Application (just hit Ctrl+Enter on the project in the Solution Window, and make that change).

That will compile the application as a Console Application, and you''ll get a console. However, you''ll still get your forms. If you want to not have Windows Forms, you''ll need to remove the forms, and replace their functionality with command line arguments or configuration. You can then remove the Windows Forms references, and it''ll be converted.
I''ve copied it from
http://stackoverflow.com/a/3427089[here] answered by Reed Copsey


这篇关于我可以将Windows应用程序转换为控制台应用程序吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆