本文整理汇总了VB.NET中System.Web.Services.Protocols.MatchAttribute类的典型用法代码示例。如果您正苦于以下问题:VB.NET MatchAttribute类的具体用法?VB.NET MatchAttribute怎么用?VB.NET MatchAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MatchAttribute类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: MatchAttribute_Example
' 导入命名空间
Imports System.Web.Services.Protocols
Public Class MatchAttribute_Example
Inherits HttpGetClientProtocol
Public Sub New()
Url = "http://localhost"
End Sub
<HttpMethodAttribute(GetType(TextReturnReader), GetType(UrlParameterWriter))> _
Public Function GetHeaders() As Headers
Return CType(Invoke("GetHeaders", Url + "/MyHeaders.html", New Object(0) {}), Headers)
End Function 'GetHeaders
Public Function BeginGetHeaders(ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As _
System.IAsyncResult
Return BeginInvoke("GetHeaders", Url + "/MyHeaders.html", New Object(0) {}, _
callback, asyncState)
End Function 'BeginGetHeaders
Public Function EndGetHeaders(ByVal asyncResult As System.IAsyncResult) As Headers
Return CType(EndInvoke(asyncResult), Headers)
End Function 'EndGetHeaders
End Class
Public Class Headers
<MatchAttribute("TITLE>(.*?)<")> _
Public Title As String
<MatchAttribute("", Pattern:="h1>(.*?)<", IgnoreCase:=True)> _
Public H1 As String
<MatchAttribute("H2>((([^<,]*),?)+)<", Group:=3, Capture:=4)> _
Public Element As String
<MatchAttribute("H2>((([^<,]*),?){2,})<", Group:=3, MaxRepeats:=0)> _
Public Elements1() As String
<MatchAttribute("H2>((([^<,]*),?){2,})<", Group:=3, MaxRepeats:=1)> _
Public Elements2() As String
<MatchAttribute("H3 ([^=]*)=([^>]*)", Group:=1)> _
Public Attribute As String
<MatchAttribute("H3 ([^=]*)=([^>]*)", Group:=2)> _
Public Value As String
End Class