c# foreach namevaluecollection

C#
NameValueCollection nv = HttpUtility.ParseQueryString(queryString);        
foreach (string key in nv) {
    var value = nv[key];

}
Source

Also in C#: