C# Класс LtiLibrary.Core.Common.UrlEncodingParser

A query string or UrlEncoded form parser and editor class that allows reading and writing of urlencoded key value pairs used for query string and HTTP form data. Useful for parsing and editing querystrings inside of non-Web code that doesn't have easy access to the HttpUtility class.
Supports multiple values per key From Rick Strahl, http://weblog.west-wind.com/posts/2014/Sep/08/A-NET-QueryString-and-Form-Data-Parser
Наследование: System.Collections.Specialized.NameValueCollection
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
Parse ( string query ) : NameValueCollection

Parses the query string into the internal dictionary and optionally also returns this dictionary

SetValues ( string key, IEnumerable values ) : void

Assigns multiple values to the same key

ToString ( ) : string

Writes out the urlencoded data/query string or full URL based on the internally set values.

UrlEncodingParser ( string queryStringOrUrl = null ) : System

Always pass in a UrlEncoded data or a URL to parse from unless you are creating a new one from scratch.

Описание методов

Parse() публичный Метод

Parses the query string into the internal dictionary and optionally also returns this dictionary
public Parse ( string query ) : NameValueCollection
query string /// Query string key value pairs or a full URL. If URL is /// passed the URL is re-written in Write operation ///
Результат System.Collections.Specialized.NameValueCollection

SetValues() публичный Метод

Assigns multiple values to the same key
public SetValues ( string key, IEnumerable values ) : void
key string
values IEnumerable
Результат void

ToString() публичный Метод

Writes out the urlencoded data/query string or full URL based on the internally set values.
public ToString ( ) : string
Результат string

UrlEncodingParser() публичный Метод

Always pass in a UrlEncoded data or a URL to parse from unless you are creating a new one from scratch.
public UrlEncodingParser ( string queryStringOrUrl = null ) : System
queryStringOrUrl string /// Pass a query string or raw Form data, or a full URL. /// If a URL is parsed the part prior to the ? is stripped /// but saved. Then when you write the original URL is /// re-written with the new query string. ///
Результат System