vb System.UriTemplate.Match类(方法)实例源码

下面列出了vb System.UriTemplate.Match 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:Syste   
Dim template As UriTemplate = New UriTemplate("weather/{state}/{city}?forecast={day}")
Dim prefix As Uri = New Uri("http://localhost")

Dim fullUri As Uri = New Uri("http://localhost/weather/Washington/Redmond?forecast=today")
Dim results As UriTemplateMatch = template.Match(prefix, fullUri)

Console.WriteLine("Matching {0} to {1}", template.ToString(), fullUri.ToString())

If results IsNot Nothing Then
    For Each variableName As String In results.BoundVariables.Keys
        Console.WriteLine("   {0}: {1}", variableName, results.BoundVariables(variableName))
    Next
End If


问题


面经


文章

微信
公众号

扫码关注公众号