|
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
|
Tradução
Original
|
Classe UriTemplate
Assembly: System.ServiceModel (em System.ServiceModel.dll)
O tipo UriTemplate expõe os membros a seguir.
| Nome | Descrição | |
|---|---|---|
![]() | UriTemplate(String) | |
![]() | UriTemplate(String, Boolean) | |
![]() | UriTemplate(String, IDictionary<String, String>) | |
![]() | UriTemplate(String, Boolean, IDictionary<String, String>) |
| Nome | Descrição | |
|---|---|---|
![]() | Defaults | |
![]() | IgnoreTrailingSlash | |
![]() | PathSegmentVariableNames | |
![]() | QueryValueVariableNames |
| Nome | Descrição | |
|---|---|---|
![]() | BindByName(Uri, IDictionary<String, String>) | |
![]() | BindByName(Uri, NameValueCollection) | |
![]() | BindByName(Uri, IDictionary<String, String>, Boolean) | |
![]() | BindByName(Uri, NameValueCollection, Boolean) | |
![]() | BindByPosition | |
![]() | Equals(Object) | |
![]() | Finalize | |
![]() | GetHashCode | |
![]() | GetType | |
![]() | IsEquivalentTo | |
![]() | Match | |
![]() | MemberwiseClone | |
![]() | ToString |
"WA/temperatura/Seattle" "sobre / {state} / {cidade}" "clima / *" "sobre / {state} / {cidade}? previsão = hoje "sobre / {state} / {cidade}? previsão = {dia}
UriTemplate template = new UriTemplate("weather/{state}/{city}?forecast={day}"); Uri prefix = new Uri("http://localhost"); Console.WriteLine("PathSegmentVariableNames:"); foreach (string name in template.PathSegmentVariableNames) { Console.WriteLine(" {0}", name); } Console.WriteLine(); Console.WriteLine("QueryValueVariableNames:"); foreach (string name in template.QueryValueVariableNames) { Console.WriteLine(" {0}", name); } Console.WriteLine(); Uri positionalUri = template.BindByPosition(prefix, "Washington", "Redmond", "Today"); NameValueCollection parameters = new NameValueCollection(); parameters.Add("state", "Washington"); parameters.Add("city", "Redmond"); parameters.Add("day", "Today"); Uri namedUri = template.BindByName(prefix, parameters); Uri fullUri = new Uri("http://localhost/weather/Washington/Redmond?forecast=today"); UriTemplateMatch results = template.Match(prefix, fullUri); Console.WriteLine("Matching {0} to {1}", template.ToString(), fullUri.ToString()); if (results != null) { foreach (string variableName in results.BoundVariables.Keys) { Console.WriteLine(" {0}: {1}", variableName, results.BoundVariables[variableName]); } }
Windows 7, Windows Vista SP1 ou posterior, Windows XP SP3, Windows Server 2008 (Server Core não compatível), Windows Server 2008 R2 (Server Core não compatível com SP1 ou posterior), Windows Server 2003 SP2
O .NET Framework não oferece suporte a todas as versões de cada plataforma. Para obter uma lista das versões com suporte, consulte Requisitos de sistema do .NET Framework.
