System.Net.CookieParser.GetString C# (CSharp) Method

GetString() private method

private GetString ( ) : string
return string
        internal string GetString()
        {
            bool first = true;

            if (_tokenizer.Eof)
            {
                return null;
            }

            do
            {
                _tokenizer.Next(first, true);
                first = false;
            } while (!_tokenizer.Eof && !_tokenizer.EndOfCookie);

            return _tokenizer.GetCookieString();
        }

Usage Example

示例#1
1
        internal static IEnumerable<string> GetCookiesFromHeader(string setCookieHeader) 
        {
            List<string> cookieStrings = new List<string>();
            
            try
            {
                CookieParser parser = new CookieParser(setCookieHeader);
                string cookieString;

                while ((cookieString = parser.GetString()) != null)
                {
                    cookieStrings.Add(cookieString);
                }
            }
            catch (InternalCookieException)
            {
                // TODO: We should log this.  But there isn't much we can do about it other
                // than to drop the rest of the cookies.
            }
            
            return cookieStrings;
        }
All Usage Examples Of System.Net.CookieParser::GetString