This article was translated by machine. To view in the article in English, select the English check box. You can also display the English text in a popup window by moving the mouse pointer over the text.
الترجمة
الأصلي
This documentation is archived and is not being maintained.

MimeTextBinding الفئة

Visual Studio 2010

Represents an التوافق مع البرامج الخارجية عنصر تمت الإضافة إلى an InputBinding, an OutputBinding, أو a MimePart, specifying the نص أنماط for which إلى بحث the HTTP transmission. و هذه الفئة لا يمكن أن تكون موروثة.

مساحة الاسم:  System.Web.Services.Description
التجميع:  System.Web.Services (في System.Web.Services.dll)

[XmlFormatExtensionAttribute("text", "http://microsoft.com/wsdl/mime/textMatching/", 
	typeof(InputBinding), typeof(OutputBinding), typeof(MimePart))]
[XmlFormatExtensionPrefixAttribute("tm", "http://microsoft.com/wsdl/mime/textMatching/")]
public sealed class MimeTextBinding : ServiceDescriptionFormatExtension

لمزيد من المعلومات حول تعيين البروتوكولات الخاصة ‏‫الخدمات الويب لـ XML، راجع [<topic://cpconbuildingaspnetwebservices>]. ل المزيد معلومات حول ويب الخدمات الوصف اللغة (WSDL)، راجع المواصفات في http://www.w3.org/TR/wsdl/.


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;      
// <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.
         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 );
      }
    }
}


يتم تأمين العملية الجزئية لأي عضو عمومي ثابت (مشترك في Visual Basic) من هذا النوع. لن يتم ضمان تأمين العملية الجزئية لأي عضو مثيل.

نظام التشغيل Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, الإصدار x64 من نظام التشغيل Windows XP Professional, Windows XP Starter Edition, Windows Server 2008, نظام التشغيل Windows Server 2003, نظام التشغيل Windows Server 2000 المزود بحزمة الخدمة SP4, نظام التشغيل Windows Millennium Edition, نظام التشغيل Windows 98

لا يدعم .NET Framework و .NET Compact Framework كافة الإصدارات الخاصة بكل نظام أساسي. للحصول على قائمة بالإصدارات المدعمة، راجع متطلبات النظام إطار عمل .NET.

.NET Framework

مدعوم في: 4, 3.5, 3.0, 2.0, 1.1, 1.0

NET Framework. Client Profile

مدعوم في: 4
إظهار: