Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ParseQueryString() [2/2]

static NameValueCollection System.Web.HttpUtility.ParseQueryString ( string query,
Encoding encoding )
inlinestatic

Definition at line 55 of file HttpUtility.cs.

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();
66 int length = query.Length;
67 int num = ((length > 0 && query[0] == '?') ? 1 : 0);
68 if (length == num)
69 {
70 return httpQSCollection;
71 }
72 while (num <= length)
73 {
74 int num2 = -1;
75 int num3 = -1;
76 for (int i = num; i < length; i++)
77 {
78 if (num2 == -1 && query[i] == '=')
79 {
80 num2 = i + 1;
81 }
82 else if (query[i] == '&')
83 {
84 num3 = i;
85 break;
86 }
87 }
88 string name;
89 if (num2 == -1)
90 {
91 name = null;
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)

References System.Collections.Specialized.NameValueCollection.Add(), System.length, System.Web.HttpUtility.UrlDecode(), and System.value.