更新时间:2022-02-08 23:02:23
容易!
似乎难以置信,但它具有魅力。当您要执行没有任何迹象的自定义任务时,我已将其用于某些安装项目。
It seems hard to believe, but it works as a charm. I have used this for some setup projects, when you want to perform custom tasks with no signs of it.
永远不要调用任何形式。只需保持与控制台应用程序完全一样
Never make calls to any form. Just keep on in exactly as in your console application
class Program
{
static void Main(string[] args)
{
// Just don't call Application.Run(new frmMain(args));
// ... your code
}
}
这是因为Windows应用程序项目与控制台并没有真正的不同,除了第一种形式和引用之外。
这是完全隐藏的执行。试试吧!
This is because windows application projects are no really different than console, except because of the first form and references. It is totally hidden execution. Try it!