转换winform应用程序到控制台应用程序 [英] Convert Winform App to Console app

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

问题描述

有一个快速和肮脏的方式(或VS宏)​​到WinForms应用程序转换为一个控制台应用程序?我有一个数字,不再需要为应用程序的WinForms这些应用程序。我想我可以创建一批新项目,并在复制粘贴模块和类,但如果它是除去单一形式的只是一个问题,我已经和编辑/删除几件事情,我宁愿做。

Is there a quick and dirty way (or a VS Macro) to convert a WinForms app to a Console App? I have a number of these apps that are no longer needed as Winforms apps. I suppose I could create a bunch of new projects and copy paste modules and classes over, but if it's just a matter of removing the single form that I have and editing/deleting a few things, I'd rather do that.

推荐答案

您可以更改项目设置来创建一个控制台应用程序,而不是Windows应用程序(只需按下Ctrl + Enter键在Solution窗口的项目,使该变化)。

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).

这将编译应用程序作为一个控制台应用程序,你会得到一个控制台。不过,你还是会得到你的表格。如果你想不会有Windows窗体,你将需要删除的形式,并取代它们的功能与命令行参数或配置。然后,您可以删除Windows窗体引用,它会被转换。

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.

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

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