Add array to key in web.config

前端 未结 1 646
谎友^
谎友^ 2021-02-03 22:10

I was wondering if its possible to put an array as a value in a key...example


         


        
1条回答
  •  庸人自扰
    2021-02-03 22:34

    With ConfigurationManager.AppSettings you can only retrieve scalar values. For your example, if you seperate your emails with a semicolon, you can do:

    string[] emails = ConfigurationManager.AppSettings["email"].Split(';');
    

    with the web.config

    
    

    0 讨论(0)
提交回复
热议问题