Windows Console Application - Access private method in to the main function

Last Reply on Sep 20, 2013 04:02 AM By Mudassar

Posted on Sep 20, 2013 04:02 AM

hi all,

Am new in c# console application , i have a few clarification that is ,

is there any possibility to access private method in to the main function

my code below:

 

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
       
        static void Main(string[] args)
        {
            
           
        }
       
        public class c : Program
        {
           
                private void sample()
                {
                    Console.WriteLine("hi");
                    Console.ReadKey();
                }
            }

        }
   
    }
    

thanks in advance.

Posted on Sep 20, 2013 04:02 AM

No you cannot unless you define it in Program class

 

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html