Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Unfortunately C# doesn't have its own implementation of the InputBox method so what you have is correct:

Microsoft.VisualBasic.Interaction.InputBox("How Old are you?","Age Box","22")

However if you add a using statement you can have shorter syntax in your code

using Microsoft.VisualBasic;

public void Message()
{
    Interaction.InputBox("How Old are you?","Age Box","22");
}

Here is a duplicate of the question: What is the C# version of VB.NET's InputBox?What is the C# version of VB.NET's InputBox? And a Social.Msdn post: Social MSDN Link

Unfortunately C# doesn't have its own implementation of the InputBox method so what you have is correct:

Microsoft.VisualBasic.Interaction.InputBox("How Old are you?","Age Box","22")

However if you add a using statement you can have shorter syntax in your code

using Microsoft.VisualBasic;

public void Message()
{
    Interaction.InputBox("How Old are you?","Age Box","22");
}

Here is a duplicate of the question: What is the C# version of VB.NET's InputBox? And a Social.Msdn post: Social MSDN Link

Unfortunately C# doesn't have its own implementation of the InputBox method so what you have is correct:

Microsoft.VisualBasic.Interaction.InputBox("How Old are you?","Age Box","22")

However if you add a using statement you can have shorter syntax in your code

using Microsoft.VisualBasic;

public void Message()
{
    Interaction.InputBox("How Old are you?","Age Box","22");
}

Here is a duplicate of the question: What is the C# version of VB.NET's InputBox? And a Social.Msdn post: Social MSDN Link

Source Link
JEV
  • 2.5k
  • 4
  • 36
  • 47

Unfortunately C# doesn't have its own implementation of the InputBox method so what you have is correct:

Microsoft.VisualBasic.Interaction.InputBox("How Old are you?","Age Box","22")

However if you add a using statement you can have shorter syntax in your code

using Microsoft.VisualBasic;

public void Message()
{
    Interaction.InputBox("How Old are you?","Age Box","22");
}

Here is a duplicate of the question: What is the C# version of VB.NET's InputBox? And a Social.Msdn post: Social MSDN Link