Advertisement
Guest User

ToQueryString c#

a guest
Apr 28th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1.  
  2. private static string ToQueryString(NameValueCollection values){
  3.    var httpCollection = HttpUtility.ParseQueryString("");
  4.    httpCollection.Add(values);
  5.    return httpCollection.ToString();
  6. }
  7.  
  8. private static string ToQueryString(IDictionary<string, string> values){
  9.    var httpCollection = HttpUtility.ParseQueryString("");
  10.    foreach (var entry in values){
  11.      httpCollection.Add(entry.Key, entry.Value);
  12.    }
  13.    return httpCollection.ToString();
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement