MimeTextMatch Klasse

Definition

Stellt ein Textmuster dar, nach dem die HTTP-Übertragung durchsucht wird. Diese Klasse kann nicht vererbt werden.

public ref class MimeTextMatch sealed
public sealed class MimeTextMatch
type MimeTextMatch = class
Public NotInheritable Class MimeTextMatch
Vererbung
MimeTextMatch

Beispiele

Im folgenden Beispiel wird die Verwendung der Eigenschaften und Methoden veranschaulicht, die von der MimeTextMatch -Klasse verfügbar gemacht werden.

#using <System.Xml.dll>
#using <System.Web.Services.dll>
#using <System.dll>

using namespace System;
using namespace System::Web::Services::Description;
using namespace System::Collections;
using namespace System::Xml;

int main()
{
   try
   {
      ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimeText_Binding_Match_8_Input_CPP.wsdl" );

      // Create a Binding.
      Binding^ myBinding = gcnew Binding;

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

      // Create an HttpBinding.
      HttpBinding^ myHttpBinding = gcnew HttpBinding;
      myHttpBinding->Verb = "POST";

      // Add the HttpBinding to the Binding.
      myBinding->Extensions->Add( myHttpBinding );

      // Create an OperationBinding.
      OperationBinding^ myOperationBinding = gcnew OperationBinding;
      myOperationBinding->Name = "AddNumbers";
      HttpOperationBinding^ myHttpOperationBinding = gcnew HttpOperationBinding;
      myHttpOperationBinding->Location = "/AddNumbers";

      // Add the HttpOperationBinding to the OperationBinding.
      myOperationBinding->Extensions->Add( myHttpOperationBinding );

      // Create an InputBinding.
      InputBinding^ myInputBinding = gcnew InputBinding;
      MimeContentBinding^ postMimeContentbinding = gcnew MimeContentBinding;
      postMimeContentbinding->Type = "application/x-www-form-urlencoded";
      myInputBinding->Extensions->Add( postMimeContentbinding );

      // Add the InputBinding to the OperationBinding.
      myOperationBinding->Input = myInputBinding;

      // Create an OutputBinding.
      OutputBinding^ myOutputBinding = gcnew OutputBinding;

      // Create a MimeTextBinding.
      MimeTextBinding^ myMimeTextBinding = gcnew MimeTextBinding;

      // Create a MimeTextMatch.
      MimeTextMatch^ myMimeTextMatch = gcnew MimeTextMatch;
      MimeTextMatchCollection^ myMimeTextMatchCollection;

      // Initialize properties of the MimeTextMatch.
      myMimeTextMatch->Name = "Title";
      myMimeTextMatch->Type = "*/*";
      myMimeTextMatch->Pattern = "'TITLE>(.*?)<";
      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;

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

      // Add the OperationBinding to the Binding.
      myBinding->Operations->Add( myOperationBinding );

      // Add the Binding to the BindingCollection of the ServiceDescription.
      myServiceDescription->Bindings->Add( myBinding );

      // Write the ServiceDescription as a WSDL file.
      myServiceDescription->Write( "MimeText_Binding_Match_8_Output_CPP.wsdl" );
      Console::WriteLine( "WSDL file named 'MimeText_Binding_Match_8_Output_CPP.wsdl' was"
      " created successfully." );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Exception: {0}", e->Message );
   }
}
using System;
using System.Web.Services.Description;
using System.Collections;
using System.Xml;

class MyTextBinding
{
   public static void Main()
   {
      try
      {
         ServiceDescription myServiceDescription =
            ServiceDescription.Read("MimeText_Binding_Match_8_Input_CS.wsdl");

         // 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();
         myHttpBinding.Verb="POST";

         // Add the HttpBinding to the Binding.
         myBinding.Extensions.Add(myHttpBinding);

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

         HttpOperationBinding myHttpOperationBinding =
            new HttpOperationBinding();
         myHttpOperationBinding.Location="/AddNumbers";

         // Add the HttpOperationBinding to the OperationBinding.
         myOperationBinding.Extensions.Add(myHttpOperationBinding);

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

         // Add the InputBinding to the OperationBinding.
         myOperationBinding.Input = myInputBinding;
               // 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>(.*?)<";
               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;
         // Add the OutputBinding to the OperationBinding.
         myOperationBinding.Output = myOutputBinding;

         // Add the OperationBinding to the Binding.
         myBinding.Operations.Add(myOperationBinding);

         // Add the Binding to the BindingCollection of the ServiceDescription.
         myServiceDescription.Bindings.Add(myBinding);

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

Class MyTextBinding
   Public Shared Sub Main()
      Try
         Dim myServiceDescription As ServiceDescription = _
               ServiceDescription.Read("MimeText_Binding_Match_8_Input_vb.wsdl")

         ' Create a Binding.
         Dim myBinding As New Binding()

         ' Initialize the Name property of the Binding.
         myBinding.Name = "MimeText_Binding_MatchServiceHttpPost"
         Dim myXmlQualifiedName As _
               New XmlQualifiedName("s0:MimeText_Binding_MatchServiceHttpPost")
         myBinding.Type = myXmlQualifiedName

         ' Create an HttpBinding.
         Dim myHttpBinding As New HttpBinding()
         myHttpBinding.Verb = "POST"

         ' Add the HttpBinding to the Binding.
         myBinding.Extensions.Add(myHttpBinding)

         ' Create an OperationBinding.
         Dim myOperationBinding As New OperationBinding()
         myOperationBinding.Name = "AddNumbers"

         Dim myHttpOperationBinding As New HttpOperationBinding()
         myHttpOperationBinding.Location = "/AddNumbers"

         ' Add the HttpOperationBinding to the OperationBinding.
         myOperationBinding.Extensions.Add(myHttpOperationBinding)

         ' Create an InputBinding.
         Dim myInputBinding As New InputBinding()
         Dim postMimeContentbinding As New MimeContentBinding()
         postMimeContentbinding.Type = "application/x-www-form-urlencoded"
         myInputBinding.Extensions.Add(postMimeContentbinding)

         ' Add the InputBinding to the OperationBinding.
         myOperationBinding.Input = myInputBinding
         ' Create an OutputBinding.
         Dim myOutputBinding As New OutputBinding()

         ' Create a MimeTextBinding.
         Dim myMimeTextBinding As New MimeTextBinding()

         ' Create a MimeTextMatch.
         Dim myMimeTextMatch As New MimeTextMatch()
         Dim myMimeTextMatchCollection As MimeTextMatchCollection

         ' Initialize properties of the MimeTextMatch.
         myMimeTextMatch.Name = "Title"
         myMimeTextMatch.Type = "*/*"
         myMimeTextMatch.Pattern = "'TITLE>(.*?)<"
         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
         ' Add the OutputBinding to the OperationBinding.
         myOperationBinding.Output = myOutputBinding

         ' Add the OperationBinding to the Binding.
         myBinding.Operations.Add(myOperationBinding)

         ' Add the Binding to the BindingCollection of the ServiceDescription.
         myServiceDescription.Bindings.Add(myBinding)

         ' Write the ServiceDescription as a WSDL file.
         myServiceDescription.Write("MimeText_Binding_Match_8_Output_vb.wsdl")
         Console.WriteLine("WSDL file named " & _
            "'MimeText_Binding_Match_8_Output_vb.wsdl' was" & _
            " created successfully.")
      Catch e As Exception
         Console.WriteLine("Exception: {0}", e.Message)
      End Try
   End Sub
End Class

Hinweise

Weitere Informationen zum Angeben von Protokollen für XML-Webdienste finden Sie unter XML-Webdienste mit ASP.NET. Weitere Informationen zur Web Services Description Language (WSDL) finden Sie in der WSDL-Spezifikation .

Konstruktoren

MimeTextMatch()

Initialisiert eine neue Instanz der MimeTextMatch-Klasse.

Eigenschaften

Capture

Ruft einen Wert ab, der den nullbasierten Index eines MimeTextMatch in einer Gruppe angibt, oder legt diesen fest.

Group

Ruft einen Wert ab, der die Anzahl der Gruppen angibt, in denen die Ergebnisse der Textsuche platziert werden sollen, oder legt diesen fest.

IgnoreCase

Ruft einen Wert ab, der angibt, ob bei der Suche die Groß- und Kleinschreibung im zu durchsuchenden Text nicht berücksichtigt werden soll, oder legt diesen fest.

Matches

Ruft die Auflistung der Entsprechungen von Textmustern ab, die bei der Suche gefunden wurden.

Name

Ruft den Namen der MimeTextMatch ab oder legt diesen fest.

Pattern

Ruft das Textmuster für die Suche ab oder legt dieses fest.

Repeats

Ruft einen Wert ab, der angibt, wie oft die Suche ausgeführt werden soll, oder legt diesen fest.

RepeatsString

Ruft einen Wert ab, der angibt, wie oft die Suche ausgeführt werden soll, oder legt diesen fest.

Type

Ruft einen Wert ab, der das MIME-Format des zu durchsuchenden Texts angibt, oder legt diesen fest.

Methoden

Equals(Object)

Bestimmt, ob das angegebene Objekt gleich dem aktuellen Objekt ist.

(Geerbt von Object)
GetHashCode()

Fungiert als Standardhashfunktion.

(Geerbt von Object)
GetType()

Ruft den Type der aktuellen Instanz ab.

(Geerbt von Object)
MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.

(Geerbt von Object)
ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.

(Geerbt von Object)

Gilt für: