Advertisement
Guest User

System.Web.HttpUtility

a guest
Jan 9th, 2013
1,695
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 17.13 KB | None | 0 0
  1.  
  2. //
  3. // System.Web.HttpUtility
  4. //
  5. // Authors:
  6. //   Patrik Torstensson (Patrik.Torstensson@labs2.com)
  7. //   Wictor Wilén (decode/encode functions) (wictor@ibizkit.se)
  8. //   Tim Coleman (tim@timcoleman.com)
  9. //   Gonzalo Paniagua Javier (gonzalo@ximian.com)
  10. //
  11. // Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
  12. //
  13. // Permission is hereby granted, free of charge, to any person obtaining
  14. // a copy of this software and associated documentation files (the
  15. // "Software"), to deal in the Software without restriction, including
  16. // without limitation the rights to use, copy, modify, merge, publish,
  17. // distribute, sublicense, and/or sell copies of the Software, and to
  18. // permit persons to whom the Software is furnished to do so, subject to
  19. // the following conditions:
  20. //
  21. // The above copyright notice and this permission notice shall be
  22. // included in all copies or substantial portions of the Software.
  23. //
  24. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  25. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  26. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  27. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  28. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  29. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  30. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  31. //
  32.  
  33. using System.Collections;
  34. using System.Collections.Generic;
  35. using System.Collections.Specialized;
  36. using System.Globalization;
  37. using System.IO;
  38. using System.Security.Permissions;
  39. using System.Text;
  40. using System.Web.Util;
  41.  
  42. namespace System.Web {
  43.  
  44. #if !MOBILE
  45.     // CAS - no InheritanceDemand here as the class is sealed
  46.     [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
  47. #endif
  48.     public sealed class HttpUtility
  49.     {
  50.         sealed class HttpQSCollection : NameValueCollection
  51.         {
  52.             public override string ToString ()
  53.             {
  54.                 int count = Count;
  55.                 if (count == 0)
  56.                     return "";
  57.                 StringBuilder sb = new StringBuilder ();
  58.                 string [] keys = AllKeys;
  59.                 for (int i = 0; i < count; i++) {
  60.                     sb.AppendFormat ("{0}={1}&", keys [i], this [keys [i]]);
  61.                 }
  62.                 if (sb.Length > 0)
  63.                     sb.Length--;
  64.                 return sb.ToString ();
  65.             }
  66.         }
  67.        
  68.         #region Constructors
  69.  
  70.         public HttpUtility ()
  71.         {
  72.         }
  73.    
  74.         #endregion // Constructors
  75.    
  76.         #region Methods
  77.    
  78.         public static void HtmlAttributeEncode (string s, TextWriter output)
  79.         {
  80.             if (output == null) {
  81. #if NET_4_0
  82.                 throw new ArgumentNullException ("output");
  83. #else
  84.                 throw new NullReferenceException (".NET emulation");
  85. #endif
  86.             }
  87. #if NET_4_0
  88.             HttpEncoder.Current.HtmlAttributeEncode (s, output);
  89. #else
  90.             output.Write (HttpEncoder.HtmlAttributeEncode (s));
  91. #endif
  92.         }
  93.    
  94.         public static string HtmlAttributeEncode (string s)
  95.         {
  96. #if NET_4_0
  97.             if (s == null)
  98.                 return null;
  99.            
  100.             using (var sw = new StringWriter ()) {
  101.                 HttpEncoder.Current.HtmlAttributeEncode (s, sw);
  102.                 return sw.ToString ();
  103.             }
  104. #else
  105.             return HttpEncoder.HtmlAttributeEncode (s);
  106. #endif
  107.         }
  108.    
  109.         public static string UrlDecode (string str)
  110.         {
  111.             return UrlDecode(str, Encoding.UTF8);
  112.         }
  113.    
  114.         static char [] GetChars (MemoryStream b, Encoding e)
  115.         {
  116.             return e.GetChars (b.GetBuffer (), 0, (int) b.Length);
  117.         }
  118.  
  119.         static void WriteCharBytes (IList buf, char ch, Encoding e)
  120.         {
  121.             if (ch > 255) {
  122.                 foreach (byte b in e.GetBytes (new char[] { ch }))
  123.                     buf.Add (b);
  124.             } else
  125.                 buf.Add ((byte)ch);
  126.         }
  127.        
  128.         public static string UrlDecode (string s, Encoding e)
  129.         {
  130.             if (null == s)
  131.                 return null;
  132.  
  133.             if (s.IndexOf ('%') == -1 && s.IndexOf ('+') == -1)
  134.                 return s;
  135.            
  136.             if (e == null)
  137.                 e = Encoding.UTF8;
  138.  
  139.             long len = s.Length;
  140.             var bytes = new List <byte> ();
  141.             int xchar;
  142.             char ch;
  143.            
  144.             for (int i = 0; i < len; i++) {
  145.                 ch = s [i];
  146.                 if (ch == '%' && i + 2 < len && s [i + 1] != '%') {
  147.                     if (s [i + 1] == 'u' && i + 5 < len) {
  148.                         // unicode hex sequence
  149.                         xchar = GetChar (s, i + 2, 4);
  150.                         if (xchar != -1) {
  151.                             WriteCharBytes (bytes, (char)xchar, e);
  152.                             i += 5;
  153.                         } else
  154.                             WriteCharBytes (bytes, '%', e);
  155.                     } else if ((xchar = GetChar (s, i + 1, 2)) != -1) {
  156.                         WriteCharBytes (bytes, (char)xchar, e);
  157.                         i += 2;
  158.                     } else {
  159.                         WriteCharBytes (bytes, '%', e);
  160.                     }
  161.                     continue;
  162.                 }
  163.  
  164.                 if (ch == '+')
  165.                     WriteCharBytes (bytes, ' ', e);
  166.                 else
  167.                     WriteCharBytes (bytes, ch, e);
  168.             }
  169.            
  170.             byte[] buf = bytes.ToArray ();
  171.             bytes = null;
  172.             return e.GetString (buf);
  173.            
  174.         }
  175.    
  176.         public static string UrlDecode (byte [] bytes, Encoding e)
  177.         {
  178.             if (bytes == null)
  179.                 return null;
  180.  
  181.             return UrlDecode (bytes, 0, bytes.Length, e);
  182.         }
  183.  
  184.         static int GetInt (byte b)
  185.         {
  186.             char c = (char) b;
  187.             if (c >= '0' && c <= '9')
  188.                 return c - '0';
  189.  
  190.             if (c >= 'a' && c <= 'f')
  191.                 return c - 'a' + 10;
  192.  
  193.             if (c >= 'A' && c <= 'F')
  194.                 return c - 'A' + 10;
  195.  
  196.             return -1;
  197.         }
  198.  
  199.         static int GetChar (byte [] bytes, int offset, int length)
  200.         {
  201.             int value = 0;
  202.             int end = length + offset;
  203.             for (int i = offset; i < end; i++) {
  204.                 int current = GetInt (bytes [i]);
  205.                 if (current == -1)
  206.                     return -1;
  207.                 value = (value << 4) + current;
  208.             }
  209.  
  210.             return value;
  211.         }
  212.  
  213.         static int GetChar (string str, int offset, int length)
  214.         {
  215.             int val = 0;
  216.             int end = length + offset;
  217.             for (int i = offset; i < end; i++) {
  218.                 char c = str [i];
  219.                 if (c > 127)
  220.                     return -1;
  221.  
  222.                 int current = GetInt ((byte) c);
  223.                 if (current == -1)
  224.                     return -1;
  225.                 val = (val << 4) + current;
  226.             }
  227.  
  228.             return val;
  229.         }
  230.        
  231.         public static string UrlDecode (byte [] bytes, int offset, int count, Encoding e)
  232.         {
  233.             if (bytes == null)
  234.                 return null;
  235.             if (count == 0)
  236.                 return String.Empty;
  237.  
  238.             if (bytes == null)
  239.                 throw new ArgumentNullException ("bytes");
  240.  
  241.             if (offset < 0 || offset > bytes.Length)
  242.                 throw new ArgumentOutOfRangeException ("offset");
  243.  
  244.             if (count < 0 || offset + count > bytes.Length)
  245.                 throw new ArgumentOutOfRangeException ("count");
  246.  
  247.             StringBuilder output = new StringBuilder ();
  248.             MemoryStream acc = new MemoryStream ();
  249.  
  250.             int end = count + offset;
  251.             int xchar;
  252.             for (int i = offset; i < end; i++) {
  253.                 if (bytes [i] == '%' && i + 2 < count && bytes [i + 1] != '%') {
  254.                     if (bytes [i + 1] == (byte) 'u' && i + 5 < end) {
  255.                         if (acc.Length > 0) {
  256.                             output.Append (GetChars (acc, e));
  257.                             acc.SetLength (0);
  258.                         }
  259.                         xchar = GetChar (bytes, i + 2, 4);
  260.                         if (xchar != -1) {
  261.                             output.Append ((char) xchar);
  262.                             i += 5;
  263.                             continue;
  264.                         }
  265.                     } else if ((xchar = GetChar (bytes, i + 1, 2)) != -1) {
  266.                         acc.WriteByte ((byte) xchar);
  267.                         i += 2;
  268.                         continue;
  269.                     }
  270.                 }
  271.  
  272.                 if (acc.Length > 0) {
  273.                     output.Append (GetChars (acc, e));
  274.                     acc.SetLength (0);
  275.                 }
  276.  
  277.                 if (bytes [i] == '+') {
  278.                     output.Append (' ');
  279.                 } else {
  280.                     output.Append ((char) bytes [i]);
  281.                 }
  282.             }
  283.  
  284.             if (acc.Length > 0) {
  285.                 output.Append (GetChars (acc, e));
  286.             }
  287.            
  288.             acc = null;
  289.             return output.ToString ();
  290.         }
  291.    
  292.         public static byte [] UrlDecodeToBytes (byte [] bytes)
  293.         {
  294.             if (bytes == null)
  295.                 return null;
  296.  
  297.             return UrlDecodeToBytes (bytes, 0, bytes.Length);
  298.         }
  299.  
  300.         public static byte [] UrlDecodeToBytes (string str)
  301.         {
  302.             return UrlDecodeToBytes (str, Encoding.UTF8);
  303.         }
  304.  
  305.         public static byte [] UrlDecodeToBytes (string str, Encoding e)
  306.         {
  307.             if (str == null)
  308.                 return null;
  309.  
  310.             if (e == null)
  311.                 throw new ArgumentNullException ("e");
  312.  
  313.             return UrlDecodeToBytes (e.GetBytes (str));
  314.         }
  315.  
  316.         public static byte [] UrlDecodeToBytes (byte [] bytes, int offset, int count)
  317.         {
  318.             if (bytes == null)
  319.                 return null;
  320.             if (count == 0)
  321.                 return new byte [0];
  322.  
  323.             int len = bytes.Length;
  324.             if (offset < 0 || offset >= len)
  325.                 throw new ArgumentOutOfRangeException("offset");
  326.  
  327.             if (count < 0 || offset > len - count)
  328.                 throw new ArgumentOutOfRangeException("count");
  329.  
  330.             MemoryStream result = new MemoryStream ();
  331.             int end = offset + count;
  332.             for (int i = offset; i < end; i++){
  333.                 char c = (char) bytes [i];
  334.                 if (c == '+') {
  335.                     c = ' ';
  336.                 } else if (c == '%' && i < end - 2) {
  337.                     int xchar = GetChar (bytes, i + 1, 2);
  338.                     if (xchar != -1) {
  339.                         c = (char) xchar;
  340.                         i += 2;
  341.                     }
  342.                 }
  343.                 result.WriteByte ((byte) c);
  344.             }
  345.  
  346.             return result.ToArray ();
  347.         }
  348.  
  349.         public static string UrlEncode(string str)
  350.         {
  351.             return UrlEncode(str, Encoding.UTF8);
  352.         }
  353.    
  354.         public static string UrlEncode (string s, Encoding Enc)
  355.         {
  356.             if (s == null)
  357.                 return null;
  358.  
  359.             if (s == String.Empty)
  360.                 return String.Empty;
  361.  
  362.             bool needEncode = false;
  363.             int len = s.Length;
  364.             for (int i = 0; i < len; i++) {
  365.                 char c = s [i];
  366.                 if ((c < '0') || (c < 'A' && c > '9') || (c > 'Z' && c < 'a') || (c > 'z')) {
  367.                     if (HttpEncoder.NotEncoded (c))
  368.                         continue;
  369.  
  370.                     needEncode = true;
  371.                     break;
  372.                 }
  373.             }
  374.  
  375.             if (!needEncode)
  376.                 return s;
  377.  
  378.             // avoided GetByteCount call
  379.             byte [] bytes = new byte[Enc.GetMaxByteCount(s.Length)];
  380.             int realLen = Enc.GetBytes (s, 0, s.Length, bytes, 0);
  381.             return Encoding.ASCII.GetString (UrlEncodeToBytes (bytes, 0, realLen));
  382.         }
  383.      
  384.         public static string UrlEncode (byte [] bytes)
  385.         {
  386.             if (bytes == null)
  387.                 return null;
  388.  
  389.             if (bytes.Length == 0)
  390.                 return String.Empty;
  391.  
  392.             return Encoding.ASCII.GetString (UrlEncodeToBytes (bytes, 0, bytes.Length));
  393.         }
  394.  
  395.         public static string UrlEncode (byte [] bytes, int offset, int count)
  396.         {
  397.             if (bytes == null)
  398.                 return null;
  399.  
  400.             if (bytes.Length == 0)
  401.                 return String.Empty;
  402.  
  403.             return Encoding.ASCII.GetString (UrlEncodeToBytes (bytes, offset, count));
  404.         }
  405.  
  406.         public static byte [] UrlEncodeToBytes (string str)
  407.         {
  408.             return UrlEncodeToBytes (str, Encoding.UTF8);
  409.         }
  410.  
  411.         public static byte [] UrlEncodeToBytes (string str, Encoding e)
  412.         {
  413.             if (str == null)
  414.                 return null;
  415.  
  416.             if (str.Length == 0)
  417.                 return new byte [0];
  418.  
  419.             byte [] bytes = e.GetBytes (str);
  420.             return UrlEncodeToBytes (bytes, 0, bytes.Length);
  421.         }
  422.  
  423.         public static byte [] UrlEncodeToBytes (byte [] bytes)
  424.         {
  425.             if (bytes == null)
  426.                 return null;
  427.  
  428.             if (bytes.Length == 0)
  429.                 return new byte [0];
  430.  
  431.             return UrlEncodeToBytes (bytes, 0, bytes.Length);
  432.         }
  433.  
  434.         public static byte [] UrlEncodeToBytes (byte [] bytes, int offset, int count)
  435.         {
  436.             if (bytes == null)
  437.                 return null;
  438. #if NET_4_0
  439.             return HttpEncoder.Current.UrlEncode (bytes, offset, count);
  440. #else
  441.             return HttpEncoder.UrlEncodeToBytes (bytes, offset, count);
  442. #endif
  443.         }
  444.  
  445.         public static string UrlEncodeUnicode (string str)
  446.         {
  447.             if (str == null)
  448.                 return null;
  449.  
  450.             return Encoding.ASCII.GetString (UrlEncodeUnicodeToBytes (str));
  451.         }
  452.  
  453.         public static byte [] UrlEncodeUnicodeToBytes (string str)
  454.         {
  455.             if (str == null)
  456.                 return null;
  457.  
  458.             if (str.Length == 0)
  459.                 return new byte [0];
  460.  
  461.             MemoryStream result = new MemoryStream (str.Length);
  462.             foreach (char c in str){
  463.                 HttpEncoder.UrlEncodeChar (c, result, true);
  464.             }
  465.             return result.ToArray ();
  466.         }
  467.  
  468.         /// <summary>
  469.         /// Decodes an HTML-encoded string and returns the decoded string.
  470.         /// </summary>
  471.         /// <param name="s">The HTML string to decode. </param>
  472.         /// <returns>The decoded text.</returns>
  473.         public static string HtmlDecode (string s)
  474.         {
  475. #if NET_4_0
  476.             if (s == null)
  477.                 return null;
  478.            
  479.             using (var sw = new StringWriter ()) {
  480.                 HttpEncoder.Current.HtmlDecode (s, sw);
  481.                 return sw.ToString ();
  482.             }
  483. #else
  484.             return HttpEncoder.HtmlDecode (s);
  485. #endif
  486.         }
  487.    
  488.         /// <summary>
  489.         /// Decodes an HTML-encoded string and sends the resulting output to a TextWriter output stream.
  490.         /// </summary>
  491.         /// <param name="s">The HTML string to decode</param>
  492.         /// <param name="output">The TextWriter output stream containing the decoded string. </param>
  493.         public static void HtmlDecode(string s, TextWriter output)
  494.         {
  495.             if (output == null) {
  496. #if NET_4_0
  497.                 throw new ArgumentNullException ("output");
  498. #else
  499.                 throw new NullReferenceException (".NET emulation");
  500. #endif
  501.             }
  502.                
  503.             if (!String.IsNullOrEmpty (s)) {
  504. #if NET_4_0
  505.                 HttpEncoder.Current.HtmlDecode (s, output);
  506. #else
  507.                 output.Write (HttpEncoder.HtmlDecode (s));
  508. #endif
  509.             }
  510.         }
  511.  
  512.         public static string HtmlEncode (string s)
  513.         {
  514. #if NET_4_0
  515.             if (s == null)
  516.                 return null;
  517.            
  518.             using (var sw = new StringWriter ()) {
  519.                 HttpEncoder.Current.HtmlEncode (s, sw);
  520.                 return sw.ToString ();
  521.             }
  522. #else
  523.             return HttpEncoder.HtmlEncode (s);
  524. #endif
  525.         }
  526.        
  527.         /// <summary>
  528.         /// HTML-encodes a string and sends the resulting output to a TextWriter output stream.
  529.         /// </summary>
  530.         /// <param name="s">The string to encode. </param>
  531.         /// <param name="output">The TextWriter output stream containing the encoded string. </param>
  532.         public static void HtmlEncode(string s, TextWriter output)
  533.         {
  534.             if (output == null) {
  535. #if NET_4_0
  536.                 throw new ArgumentNullException ("output");
  537. #else
  538.                 throw new NullReferenceException (".NET emulation");
  539. #endif
  540.             }
  541.                
  542.             if (!String.IsNullOrEmpty (s)) {
  543. #if NET_4_0
  544.                 HttpEncoder.Current.HtmlEncode (s, output);
  545. #else
  546.                 output.Write (HttpEncoder.HtmlEncode (s));
  547. #endif
  548.             }
  549.         }
  550. #if NET_4_0
  551.         public static string HtmlEncode (object value)
  552.         {
  553.             if (value == null)
  554.                 return null;
  555.  
  556. #if !MOBILE
  557.             IHtmlString htmlString = value as IHtmlString;
  558.             if (htmlString != null)
  559.                 return htmlString.ToHtmlString ();
  560. #endif
  561.  
  562.             return HtmlEncode (value.ToString ());
  563.         }
  564.  
  565.         public static string JavaScriptStringEncode (string value)
  566.         {
  567.             return JavaScriptStringEncode (value, false);
  568.         }
  569.  
  570.         public static string JavaScriptStringEncode (string value, bool addDoubleQuotes)
  571.         {
  572.             if (String.IsNullOrEmpty (value))
  573.                 return addDoubleQuotes ? "\"\"" : String.Empty;
  574.  
  575.             int len = value.Length;
  576.             bool needEncode = false;
  577.             char c;
  578.             for (int i = 0; i < len; i++) {
  579.                 c = value [i];
  580.  
  581.                 if (c >= 0 && c <= 31 || c == 34 || c == 39 || c == 60 || c == 62 || c == 92) {
  582.                     needEncode = true;
  583.                     break;
  584.                 }
  585.             }
  586.  
  587.             if (!needEncode)
  588.                 return addDoubleQuotes ? "\"" + value + "\"" : value;
  589.  
  590.             var sb = new StringBuilder ();
  591.             if (addDoubleQuotes)
  592.                 sb.Append ('"');
  593.  
  594.             for (int i = 0; i < len; i++) {
  595.                 c = value [i];
  596.                 if (c >= 0 && c <= 7 || c == 11 || c >= 14 && c <= 31 || c == 39 || c == 60 || c == 62)
  597.                     sb.AppendFormat ("\\u{0:x4}", (int)c);
  598.                 else switch ((int)c) {
  599.                         case 8:
  600.                             sb.Append ("\\b");
  601.                             break;
  602.  
  603.                         case 9:
  604.                             sb.Append ("\\t");
  605.                             break;
  606.  
  607.                         case 10:
  608.                             sb.Append ("\\n");
  609.                             break;
  610.  
  611.                         case 12:
  612.                             sb.Append ("\\f");
  613.                             break;
  614.  
  615.                         case 13:
  616.                             sb.Append ("\\r");
  617.                             break;
  618.  
  619.                         case 34:
  620.                             sb.Append ("\\\"");
  621.                             break;
  622.  
  623.                         case 92:
  624.                             sb.Append ("\\\\");
  625.                             break;
  626.  
  627.                         default:
  628.                             sb.Append (c);
  629.                             break;
  630.                     }
  631.             }
  632.  
  633.             if (addDoubleQuotes)
  634.                 sb.Append ('"');
  635.  
  636.             return sb.ToString ();
  637.         }
  638. #endif
  639.         public static string UrlPathEncode (string s)
  640.         {
  641. #if NET_4_0
  642.             return HttpEncoder.Current.UrlPathEncode (s);
  643. #else
  644.             return HttpEncoder.UrlPathEncode (s);
  645. #endif
  646.         }
  647.  
  648.         public static NameValueCollection ParseQueryString (string query)
  649.         {
  650.             return ParseQueryString (query, Encoding.UTF8);
  651.         }
  652.  
  653.         public static NameValueCollection ParseQueryString (string query, Encoding encoding)
  654.         {
  655.             if (query == null)
  656.                 throw new ArgumentNullException ("query");
  657.             if (encoding == null)
  658.                 throw new ArgumentNullException ("encoding");
  659.             if (query.Length == 0 || (query.Length == 1 && query[0] == '?'))
  660.                 return new HttpQSCollection ();
  661.             if (query[0] == '?')
  662.                 query = query.Substring (1);
  663.                
  664.             NameValueCollection result = new HttpQSCollection ();
  665.             ParseQueryString (query, encoding, result);
  666.             return result;
  667.         }
  668.  
  669.         internal static void ParseQueryString (string query, Encoding encoding, NameValueCollection result)
  670.         {
  671.             if (query.Length == 0)
  672.                 return;
  673.  
  674.             string decoded = HtmlDecode (query);
  675.             int decodedLength = decoded.Length;
  676.             int namePos = 0;
  677.             bool first = true;
  678.             while (namePos <= decodedLength) {
  679.                 int valuePos = -1, valueEnd = -1;
  680.                 for (int q = namePos; q < decodedLength; q++) {
  681.                     if (valuePos == -1 && decoded [q] == '=') {
  682.                         valuePos = q + 1;
  683.                     } else if (decoded [q] == '&') {
  684.                         valueEnd = q;
  685.                         break;
  686.                     }
  687.                 }
  688.  
  689.                 if (first) {
  690.                     first = false;
  691.                     if (decoded [namePos] == '?')
  692.                         namePos++;
  693.                 }
  694.                
  695.                 string name, value;
  696.                 if (valuePos == -1) {
  697.                     name = null;
  698.                     valuePos = namePos;
  699.                 } else {
  700.                     name = UrlDecode (decoded.Substring (namePos, valuePos - namePos - 1), encoding);
  701.                 }
  702.                 if (valueEnd < 0) {
  703.                     namePos = -1;
  704.                     valueEnd = decoded.Length;
  705.                 } else {
  706.                     namePos = valueEnd + 1;
  707.                 }
  708.                 value = UrlDecode (decoded.Substring (valuePos, valueEnd - valuePos), encoding);
  709.  
  710.                 result.Add (name, value);
  711.                 if (namePos == -1)
  712.                     break;
  713.             }
  714.         }
  715.         #endregion // Methods
  716.     }
  717. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement