[英]How to show message box without console or form in background?
I am new to programming (c#). 我是编程(c#)的新手。 I have seen in VBScript we can show the message box (standalone). 我在VBScript中看到过,我们可以显示消息框(独立)。 I would like to do the same in C#, just for learning, but the code when executed shows a Console or Form in the background along with a messagebox. 我想在C#中这样做,只是为了学习,但是执行时的代码在后台显示控制台或窗体以及消息框。 Is it possible to only show the messagebox when the program is executed? 执行程序时是否只能显示消息框?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ConsoleApp4
{
class Program
{
static void Main(string[] args)
{
MessageBox.Show("My message");
}
}
}
For Console projects, you can hide the console as follows: 对于控制台项目,可以隐藏控制台,如下所示:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.