Tips n Tracks

  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • black color

Reference

Sample image

Microsoft .NET Framework Get Details.

Sample image

Microsoft .NET Framework Get Details.

Reference

Sample image Microsoft .NET Framework Get Details.
Sample image

Microsoft .NET Framework Get Details.


Pause a Console Application for User Input


Pause a Console Application for User Input or Pause Command in a Console Application

While working with C# or VB.NET Console Applications, you may require to pause for the user input or display a message to the user. Console application window get exit as the program execution finished. Following Piece of code will do it for you.

C#.NET

using System;
using System.Collections.Generic;
using System.Text;
 
namespace Pause {
   class Program {
      static void Main(string[] args)
    {
     Console.WriteLine("Press any key to continue…");
     Console.ReadLine(); //Pause
    }
   }
}

VB.NET

Imports System
Imports System.Text
 
Module Module1
 
    Sub Main()
        Console.WriteLine("Press any key to continue…")
        Console.ReadLine()
    End Sub
 
End Module

 

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)

*
To prove that you're not a bot, enter this code
Anti-Spam Image