本文整理汇总了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;
}