Show message Box in .net console application

前端 未结 3 2078
面向向阳花
面向向阳花 2020-12-10 00:43

How to show a message box in a .net c# or vb console application ? Something like:

 Console.WriteLine(\"Hello World\");
 MessageBox.Show(\"H         


        
3条回答
  •  星月不相逢
    2020-12-10 01:27

    In C# add the reference "PresentationFramework" in the project. Next in the class that you need the MessageBox add

    using System.Windows;
    

    also you can call the MessageBox class without the using like that:

    System.Windows.MessageBox.Show("Stackoverflow");
    

提交回复
热议问题