本文整理匯總了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