i want save Comname in a variable
i want save Comname in a variable
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh KumarRank #91 · 22.9K reputationPosted Jun 20, 2022, 11:40 PM EDT
Amit MohantyRank #112 · 20K reputationPosted Jun 21, 2022, 12:35 AM EDT
using System.Configuration;
Jaydeep PatilRank #205 · 11.7K reputationPosted Jun 21, 2022, 12:04 AM EDT
Hi,
Try this solution
List values = new List();
foreach (string key in ConfigurationManager.AppSettings)
{
if (key.StartsWith("KeyName"))
{
string value = ConfigurationManager.AppSettings[key];
values.Add(value);
}
}
string[] repositoryUrls = values.ToArray();
Sachin SinghRank #66 · 26.2K reputationPosted Jun 21, 2022, 1:16 AM EDT
Aman GuptaRank #193 · 12.4K reputationPosted Jul 4, 2022, 5:56 AM EDT