jeudi 2 décembre 2021

How to get list of method names present in a .cs class file using C# .NET [closed]

Consider that, I have a .cs file present at a physical location which has the following information

using System;

namespace GetMethodNamesFromCsFile
{
    class Program
    {
        void Main(string[] args)
        {
            GetName();
            GetAddress();
            GetPhoneNumber();
            Console.WriteLine("Hello World!");
        }
        //Private Mehtods
        private void GetName()
        {
            Console.WriteLine("Test Name");
        }
        public void GetAddress()
        {
            Console.WriteLine("Test Address");
        }
        protected void GetPhoneNumber()
        {
            Console.WriteLine("Test Phone");
        }
    }
}

So, I wanted to write a separate console program which will return me the list of methods present in the .cs file.





Aucun commentaire:

Enregistrer un commentaire