MimeTextMatch Class
Collapse the table of content
Expand the table of content

MimeTextMatch Class

Represents a text pattern for which the HTTP transmission is searched. This class cannot be inherited.


Namespace:  System.Web.Services.Description
Assembly:  System.Web.Services (in System.Web.Services.dll)

public sealed class MimeTextMatch

The MimeTextMatch type exposes the following members.

Public methodMimeTextMatchInitializes a new instance of the MimeTextMatch class.

Public propertyCaptureGets or sets a value indicating the zero-based index of a MimeTextMatch within a group.
Public propertyGroupGets or sets a value indicating the number of groups in which to place the results of the text search.
Public propertyIgnoreCaseGets or sets a value indicating whether the search should disregard the case of the text to be searched.
Public propertyMatchesGets the collection of text pattern matches that have been found by the search.
Public propertyNameGets or sets the name of the MimeTextMatch.
Public propertyPatternGets or sets the text pattern for the search.
Public propertyRepeatsGets or sets a value indicating the number of times the search is to be performed.
Public propertyRepeatsStringGets or sets a value indicating the number of times the search is to be performed.
Public propertyTypeGets or sets a value indicating the MIME format of the text to be searched.

Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

For more information about specifying protocols for XML Web services, see [<topic://cpconbuildingaspnetwebservices>]. For more information about Web Services Description Language (WSDL), see the specification at http://www.w3.org/TR/wsdl/.

The following example demonstrates the use of the properties and methods exposed by the MimeTextMatch class.

using System;
using System.Web.Services.Description;
using System.Collections;
using System.Xml;

class MyTextBinding
   public static void Main()
         ServiceDescription myServiceDescription = 

         // Create a Binding.
         Binding myBinding = new Binding();

         // Initialize the Name property of the Binding.
         myBinding.Name = "MimeText_Binding_MatchServiceHttpPost";
         XmlQualifiedName myXmlQualifiedName = 
            new XmlQualifiedName("s0:MimeText_Binding_MatchServiceHttpPost");
         myBinding.Type = myXmlQualifiedName;

         // Create an HttpBinding.
         HttpBinding myHttpBinding = new HttpBinding();

         // Add the HttpBinding to the Binding.

         // Create an OperationBinding.
         OperationBinding myOperationBinding = new OperationBinding();
         myOperationBinding.Name = "AddNumbers";

         HttpOperationBinding myHttpOperationBinding = 
            new HttpOperationBinding();

         // Add the HttpOperationBinding to the OperationBinding.

         // Create an InputBinding.
         InputBinding myInputBinding = new InputBinding();
         MimeContentBinding postMimeContentbinding = new MimeContentBinding();
         postMimeContentbinding.Type = "application/x-www-form-urlencoded";

         // Add the InputBinding to the OperationBinding.
         myOperationBinding.Input = myInputBinding;      
// <Snippet5>
               // Create an OutputBinding.
               OutputBinding myOutputBinding = new OutputBinding();

               // Create a MimeTextBinding.
               MimeTextBinding myMimeTextBinding = new MimeTextBinding();

               // Create a MimeTextMatch.
               MimeTextMatch myMimeTextMatch = new MimeTextMatch();
               MimeTextMatchCollection myMimeTextMatchCollection ;

               // Initialize properties of the MimeTextMatch.
               myMimeTextMatch.Name = "Title";
               myMimeTextMatch.Type = "*/*";
               myMimeTextMatch.Pattern = "'TITLE&gt;(.*?)&lt;";
               myMimeTextMatch.IgnoreCase = true;

               // Initialize a MimeTextMatchCollection.
               myMimeTextMatchCollection = myMimeTextBinding.Matches;

               // Add the MimeTextMatch to the MimeTextMatchCollection.
               myMimeTextMatchCollection.Add( myMimeTextMatch );
               myOutputBinding.Extensions.Add( myMimeTextBinding );

               // Add the OutputBinding to the OperationBinding.
               myOperationBinding.Output = myOutputBinding; 
// </Snippet5>
         // Add the OutputBinding to the OperationBinding.
         myOperationBinding.Output = myOutputBinding; 

         // Add the OperationBinding to the Binding.

         // Add the Binding to the BindingCollection of the ServiceDescription.

         // Write the ServiceDescription as a WSDL file.
            "WSDL file named 'MimeText_Binding_Match_8_Output_CS.wsdl' was"
            + " created successfully.");
      catch(Exception e)
         Console.WriteLine( "Exception: {0}", e.Message );

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

© 2016 Microsoft