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

◆ Port

string System.Net.Cookie.Port
getset

Definition at line 201 of file Cookie.cs.

202 {
203 get
204 {
205 return m_port;
206 }
208 set
209 {
210 m_port_implicit = false;
211 if (string.IsNullOrEmpty(value))
212 {
213 m_port = string.Empty;
214 return;
215 }
216 if (value[0] != '"' || value[value.Length - 1] != '"')
217 {
218 throw new CookieException(System.SR.Format(System.SR.net_cookie_attribute, "Port", value));
219 }
220 string[] array = value.Split(PortSplitDelimiters);
221 List<int> list = new List<int>();
222 for (int i = 0; i < array.Length; i++)
223 {
224 if (array[i] != string.Empty)
225 {
226 if (!int.TryParse(array[i], out var result))
227 {
228 throw new CookieException(System.SR.Format(System.SR.net_cookie_attribute, "Port", value));
229 }
230 if (result < 0 || result > 65535)
231 {
232 throw new CookieException(System.SR.Format(System.SR.net_cookie_attribute, "Port", value));
233 }
234 list.Add(result);
235 }
236 }
237 m_port_list = list.ToArray();
238 m_port = value;
239 m_version = 1;
240 m_cookieVariant = CookieVariant.Rfc2965;
241 }
242 }
static readonly char[] PortSplitDelimiters
Definition Cookie.cs:14
bool m_port_implicit
Definition Cookie.cs:42
CookieVariant m_cookieVariant
Definition Cookie.cs:24
int[] m_port_list
Definition Cookie.cs:44
string m_port
Definition Cookie.cs:40
static string net_cookie_attribute
Definition SR.cs:36
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7