C # itself does not have such a function, assuming you are using Winforms, but you can steal it from the default VB.NET libraries (from the namespace Microsoft.VisualBasic):
using Microsoft.VisualBasic;
class Program
{
static void Main()
{
var response = Interaction.InputBox("Enter some text!", "Title", "Default text");
}
}
See MSDN for more details .
You can also create your own window using WinForms (or WPF) if you need to do something more specific.
source
share