本文整理匯總了C#中System.Web.Services.Protocols.MatchAttribute類的典型用法代碼示例。如果您正苦於以下問題:C# MatchAttribute類的具體用法?C# MatchAttribute怎麽用?C# MatchAttribute使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MatchAttribute類屬於System.Web.Services.Protocols命名空間,在下文中一共展示了MatchAttribute類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MatchAttribute_Example
//引入命名空間
using System;
using System.Web.Services.Protocols;
public class MatchAttribute_Example : HttpGetClientProtocol
{
public MatchAttribute_Example()
{
Url = "http://localhost";
}
[HttpMethodAttribute(typeof(TextReturnReader), typeof(UrlParameterWriter))]
public Example_Headers GetHeaders()
{
return ((Example_Headers)Invoke("GetHeaders", (Url + "/MyHeaders.html"),
new object[0]));
}
public System.IAsyncResult BeginGetHeaders(System.AsyncCallback callback,
object asyncState)
{
return BeginInvoke("GetHeaders", (Url + "/MyHeaders.html"),
new object[0], callback, asyncState);
}
public Example_Headers EndGetHeaders(System.IAsyncResult asyncResult)
{
return (Example_Headers)(EndInvoke(asyncResult));
}
}
public class Example_Headers
{
[MatchAttribute("TITLE>(.*?)<")]
public string Title;
[MatchAttribute("", Pattern="h1>(.*?)<", IgnoreCase=true)]
public string H1;
[MatchAttribute("H2>((([^<,]*),?)+)<", Group=3, Capture=4)]
public string Element;
[MatchAttribute("H2>((([^<,]*),?){2,})<", Group=3, MaxRepeats=0)]
public string[] Elements1;
[MatchAttribute("H2>((([^<,]*),?){2,})<", Group=3, MaxRepeats=1)]
public string[] Elements2;
[MatchAttribute("H3 ([^=]*)=([^>]*)", Group=1)]
public string Attribute;
[MatchAttribute("H3 ([^=]*)=([^>]*)", Group=2)]
public string Value;
}