Repeating Program c#

I have this C# and it is a login program. It works like this:
The program asks you to enter specific TAG and if you get it wrong you have to put in a password to find your tag.
If enter right password you enter the team. If you don’t get the password right you have to restart program (this is the problem).

And if you get the password right and the team right you get your tag and restart program.
If you enter your team wrong you also have to restart program.

But instead of reopening the program I want so I press a button and it will print out the same program again.

Here is the code

using System;

namespace GOVERMENTPROGRAM
{
    internal class Program
    {
        static void Main(string[] args)
        {
              Console.ForegroundColor = ConsoleColor.Green;
              Console.WindowWidth = 70;
              Console.WriteLine("WELCOME TO THE A.A.A.R GOVERMENT (Sniper) PROGRAM TO ACCESS INFORMATIONnPLEASE ENTER YOUR ACCOUNT INFORMATION");
              Console.Write("TAG:");
              Console.ForegroundColor = ConsoleColor.Blue;
              String TAG = (Console.ReadLine());
              Console.ForegroundColor = ConsoleColor.Green;
              if (TAG == "A.A.A_ter5"){
                Console.WriteLine("Welcome Sniper #5");
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("MISSION OF THE DAY:");
                Console.WriteLine("A new cocaine drug dealer is trending in the city");
                Console.WriteLine("Your job is too assasinate his team and call our organization");
              }
              else {
                Console.WriteLine("That Does Not exist");
                Console.Write("Enter Organization password to reveal TAGSnPASSWORD:");
              }
              Console.ForegroundColor = ConsoleColor.Blue;
              String password = (Console.ReadLine());
              Console.ForegroundColor = ConsoleColor.Green;
              if (password == "231234TER"){
                Console.Write("TEAM(IN XXX):");
                Console.ForegroundColor = ConsoleColor.Blue;
                String TEAM = (Console.ReadLine());
                if (TEAM == "SNIPER") {
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine("A.A.A_ter1nA.A.A_ter2");
                    Console.WriteLine("A.A.A_ter3nA.A.A_ter4");
                    Console.WriteLine("A.A.A_ter5");
                    Console.WriteLine("Please close program to restart LOGIN");
                }
                else{
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine("Wrong, software login is built for specific team and you are not on that team");
                    Console.WriteLine("Please Enter TOR to restart LOGIN");
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    String TOR = (Console.ReadLine());
                    while (TOR == "TOR"){
                
              }

                }
              }
              else {
                  Console.ForegroundColor = ConsoleColor.Green;
                  Console.WriteLine("WRONG");
                  Console.WriteLine("Please Enter TER  to restart LOGIN");
              }
              String TER = (Console.ReadLine());
              Console.ForegroundColor = ConsoleColor.Yellow;
              while (TER == "TER"){
                
              }

              Console.ReadKey();
        }
    }
}

Please someone tell me how to achieve this

New contributor

ammar ahmed2 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

3

You can use a while loop:

Example:

bool state = true;

    while (state) 
    {
       // Your logic
       state = false; // To drop out of the loop (if needed)
    }

Example how I would’ve solved it (even though I had problems understanding what you wrote, sorry to say that but your requirements need to be more clear):

namespace GOVERMENTPROGRAM
{
    internal class Program
    {
        static void Main()
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WindowWidth = 70;

            Console.WriteLine("WELCOME TO THE A.A.A.R GOVERMENT (Sniper) PROGRAM TO ACCESS INFORMATIONnPLEASE ENTER YOUR ACCOUNT INFORMATION");
            Lore();
        }

        static void Lore()
        {
            bool state = true;

            while (state)
            {
                Console.Write("TAG:");

                Console.ForegroundColor = ConsoleColor.Blue;

                string TAG = (Console.ReadLine());

                Console.ForegroundColor = ConsoleColor.Green;

                if (TAG == "A.A.A_ter5")
                {
                    Console.WriteLine("Welcome Sniper #5");

                    Console.ForegroundColor = ConsoleColor.Red;

                    Console.WriteLine("MISSION OF THE DAY:");
                    Console.WriteLine("A new cocaine drug dealer is trending in the city");
                    Console.WriteLine("Your job is too assasinate his team and call our organization");
                }
                else
                {
                    Console.WriteLine("That Does Not exist");
                    state = false;
                }

                Console.ForegroundColor = ConsoleColor.Blue;

                Console.Write("Enter Organization password to reveal TAGSnPASSWORD:");
                string password = (Console.ReadLine());

                Console.ForegroundColor = ConsoleColor.Green;

                if (password == "231234TER")
                {
                    Console.Write("TEAM(IN XXX):");

                    Console.ForegroundColor = ConsoleColor.Blue;

                    string TEAM = (Console.ReadLine());

                    if (TEAM == "SNIPER")
                    {
                        Console.ForegroundColor = ConsoleColor.Green;

                        Console.WriteLine("A.A.A_ter1nA.A.A_ter2");
                        Console.WriteLine("A.A.A_ter3nA.A.A_ter4");
                        Console.WriteLine("A.A.A_ter5");
                        Console.WriteLine("Please close program to restart LOGIN");
                    }
                    else
                    {
                        Console.ForegroundColor = ConsoleColor.Green;

                        Console.WriteLine("Wrong, software login is built for specific team and you are not on that team");
                        Console.WriteLine("Please Enter TOR to restart LOGIN");

                        Console.ForegroundColor = ConsoleColor.Yellow;

                        string TOR = Console.ReadLine(); 
                        state = false;
                    }
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine("WRONG");
                    Console.WriteLine("Please Enter TER  to restart LOGIN");

                    Console.ForegroundColor = ConsoleColor.Yellow;

                    string TER = (Console.ReadLine());
                    state = false;
                }
            }

            Console.ReadKey();
            Console.Clear();
            Reset();
        }

        static void Reset()
        {
            Console.Clear();

            Console.ForegroundColor = ConsoleColor.Green;
  
            Console.WriteLine("WELCOME TO THE A.A.A.R GOVERMENT (Sniper) PROGRAM TO ACCESS INFORMATIONnPLEASE ENTER YOUR ACCOUNT INFORMATION");
            Lore();
        }
    }
}

Everything should work except the format, but that was not the question. I believe that there are many tutorials for formatting console output and that they can be found all over the net.

One major thing you should learn is to start using separate methods. I don’t know if you already used separate methods before but they can be really important, especially when it comes to code readability!

Don’t forget that there are more ways to achieve this. You could also use for(;;). Both will do the same thing when checking in CIL.

New contributor

poisonousheartz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật