how to call “ static void Main(string[] args) ”in the class again

后端 未结 5 488
渐次进展
渐次进展 2021-01-23 20:53

i am new in C# and working on Console Applications now a days i wrote the following code :

Program.cs

using System;
using System.Collect         


        
5条回答
  •  我在风中等你
    2021-01-23 21:09

    Just call the method again, passing in the same arguments that where passed in initially, also try to avoid using goto if you can:

    if (selectedOption == "y")
    {
        // howto call  static void Main(string[] args) here agin so that the program start itself from the start point
        Main(args);
    }    
    

提交回复
热议问题