C#.NET - Read comma separated values from app.config



Cheat sheet to read comma seperated values in app.config

using System.Collections;
using System.Configuration; //refer System.Configuration 
 private void Page_Load(object sender, EventArgs e)
        {
            string strValue = ConfigurationManager.AppSettings["ShareDelete"];

            string[] strArray = strValue.Split(',');

            ArrayList arList = new ArrayList();

            for (int i = 0; i < strArray.Length; i++)
            {
                arList.Add(strArray[i]);
                MessageBox.Show(strArray[i]);
            }
        }

App.Config Settings

<?xml version="1.0" encoding="utf-8" ?>

  
    
  

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.