TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
John Riker
NA
85
16.1k
Loop two associated string arrays?
Nov 10 2020 9:36 AM
I have two sets of data I have in my C# config file that are related to each other. So for example.
Config:
<
add
key
=
"shownames"
value
=
"Show 1 Name,Show 2 Name"
/>
<
add
key
=
"showurls"
value
=
"https://URL1,https://URL2"
/>
So then I call read them in with:
string
[] ShowNames = ConfigurationManager.AppSettings[
"shownames"
].Split(
','
).Select(s => s.Trim()).ToArray();
string[] ShowUrls = ConfigurationManager.AppSettings[
"showurls"
].Split(
','
).Select(s => s.Trim()).ToArray();
Then in theory I start reading in shownames
foreach
(
string
shownames
in
ShowNames)
So then I would reference the current value of shownames with:
searchListRequest.ChannelId = shownames;
But how do I reference the matching value for showurls? Do I need to reference it as a loop value like showurls[1] or something?
Thanks.
JR
Reply
Answers (
3
)
How to bind Layout with Model in MVC?
ODBC Setup in Multinode Cluster