Check out example codes for "c# foreach namevaluecollection". It will help you in understanding the concepts better.
Code Example 1
NameValueCollection nv = HttpUtility.ParseQueryString(queryString);
foreach (string key in nv) {
var value = nv[key];
}
Learn ReactJs, React Native from akashmittal.com