Posts

Showing posts from November, 2018

EncryptDecrypt Web config c#

  public static void WebEncryptDecrypt()         {             Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);             ConfigurationSection configSection = config.GetSection("appSettings");             ConnectionStringsSection ConSection = config.GetSection("connectionStrings") as ConnectionStringsSection;             if (configSection.SectionInformation.IsProtected)             {                 configSection.SectionInformation.UnprotectSection();                 ConSection.SectionInformation.UnprotectSection();                 config.Save();                           ...

sum list of object property using recursions c#

 class Program     {         static void Main(string[] args)         {             List<EMPLOYEE> employees = new List<EMPLOYEE>();             employees.Add(new EMPLOYEE { NAME = "AAAA", SALARY = 1 });             employees.Add(new EMPLOYEE { NAME = "BBBB", SALARY = 2 });             employees.Add(new EMPLOYEE { NAME = "CCCC", SALARY = 2 });             employees.Add(new EMPLOYEE { NAME = "DDDD", SALARY = 2 });             employees.Add(new EMPLOYEE { NAME = "EEEE", SALARY = 2 });             employees.Add(new EMPLOYEE { NAME = "FFFF", SALARY = 2 });             //Print total salary using recursion method in SumSalary             Console.Writ...