56 {
57 if (query == null)
58 {
59 throw new ArgumentNullException("query");
60 }
61 if (encoding == null)
62 {
63 throw new ArgumentNullException("encoding");
64 }
65 HttpQSCollection httpQSCollection = new HttpQSCollection();
67 int num = ((
length > 0 && query[0] ==
'?') ? 1 : 0);
69 {
70 return httpQSCollection;
71 }
73 {
74 int num2 = -1;
75 int num3 = -1;
77 {
78 if (num2 == -1 && query[i] == '=')
79 {
81 }
82 else if (query[i] == '&')
83 {
85 break;
86 }
87 }
89 if (num2 == -1)
90 {
92 num2 = num;
93 }
94 else
95 {
96 name =
UrlDecode(query.Substring(num, num2 - num - 1), encoding);
97 }
98 if (num3 < 0)
99 {
100 num3 = query.Length;
101 }
102 num = num3 + 1;
103 string value =
UrlDecode(query.Substring(num2, num3 - num2), encoding);
104 httpQSCollection.Add(name,
value);
105 }
106 return httpQSCollection;
107 }
static ? string UrlDecode(string? str)