عنصر httpModules (مخطط إعدادات ASP.NET)

تكوين الوحدات النمطية لـ HTTP داخل أحد تطبيقات. يمكن أن يتم تعريف هذا العنصر في أي مستوى من هيكل ملف التكوين.

<configuration>العنصر
  النظام.ويب عنصر (مخطط إعدادات ASP.NET)
    عنصر httpModules (مخطط إعدادات ASP.NET)

<httpModules> 
   <add... />
   <remove... />
   <clear/>
</httpModules>

السمات والعناصر

تصف المقاطع التالية سمات، عناصر تابعة وعناصر الأصل.

السمات

لا يوجد.

العناصر التابعة

العنصر

الوصف

add

عنصر اختياري.

يضيف httpModulesعنصر إلى التطبيق.

clear

عنصر اختياري.

إزالة كافة httpModules من التطبيقات.

remove

عنصر اختياري.

يزيل مرجع إلى httpModulesالعنصر.

يجب أن تتطابق القيمة تماماً مع إصدار سابق addالتوجيه.

العناصر الأصلية

العنصر

الوصف

configuration

تحديد جذر العنصر المطلوب في كل ملف تكوين مستخدم من قبل وقت تشغيل اللغة العامة وتطبيقات NET Framework.

system.web

تحدّد جذر العنصر لمقطع التكوين ASP.NET .

ملاحظات

التكوين الافتراضي

لعنصر الافتراضي التالي httpModules مكون في ملف Web.config الجذر في الإصدار1.1 من .NET Framework

<httpModules>
     <add name="OutputCache" type="System.Web.Caching.OutputCacheModule"/>
     <add name="Session" type="System.Web.SessionState.SessionStateModule"/>
     <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule"/>
     <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule"/>
     <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule"/>
     <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"/>
     <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule"/>
     <add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, 
          Version=1.0.5000.0, Culture=neutral, 
          PublicKeyToken=b03f5f7f11d50a3a"/>
</httpModules>

لعنصر الافتراضي التالي httpModules مكون في ملف Web.config الجذر في الإصدار1.0 من .NET Framework

<httpModules>
     <add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
     <add name="Session" type="System.Web.SessionState.SessionStateModule" />
     <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" />
     <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
     <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule" />
     <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
     <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" />
</httpModules>

العنصر الافتراضي التالي httpModules مكون في ملف Web.config الجذر في الإصدار2.0 من .NET Framework .

<httpModules>
     <add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
     <add name="Session" type="System.Web.SessionState.SessionStateModule" />
     <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" />
     <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
     <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule" />
     <add name="RoleManager" type="System.Web.Security.RoleManagerModule" />
     <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
     <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" />
     <add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule" />
     <add name="Profile" type="System.Web.Profile.ProfileModule" />
</httpModules>

مثال

يوضح مثال الرمز التالي كيفية إنشاء شجرة أعلى لأسفل HttpModule إلى تطبيق ASP.NET.

<configuration>
   <system.web>
      <httpModules>
         <add type="System.Web.Caching.OutputCacheModule" 
              name="OutputCache"/>
         <add type="System.Web.SessionState.SessionStateModule" 
              name="Session"/>
         <add type=Selector, selector.dll"
              name="Selector"/>
      </httpModules>
   </system.web>
</configuration>

معلومات العنصر

معالج مقطع التكوين

System.Web.Configuration.HttpModulesSection

عضو التكوين

SystemWebSectionGroup.HttpModules

مواقع للتكوين

Machine.config

مستوى جذر ويب.config

مستوى تطبيق ويب.config

الدليل–المستوى ويب.config الفعلية أو الظاهرية

المتطلبات

Microsoft Internet Information Services (IIS) الإصدار 5.0 أو 5.1 أو 6.0.

.NET Framework، الإصدار 1.0 أو 1.1 أو 2.0

Microsoft Visual Studio 2003 أو Visual Studio 2005

راجع أيضًا:

المهام

كيفية: تأمين إعدادات التكوين ASP.NET

المرجع

النظام.ويب عنصر (مخطط إعدادات ASP.NET)

<configuration>العنصر

عنصر الإضافة لـ httpModules (مخطط إعدادات ASP.NET)

مسح عنصر للـ httpModules (مخطط إعدادات ASP.NET)

إزالة عنصر ل httpModules (مخطط إعدادات ASP.NET)

System.Configuration

System.Web.Configuration

المبادئ

نظرة عامة حول تكوين ASP.NET

عناصر تحكم ملقم ويب ASP.NET و قدرات المستعرض

تأمين تكوين ASP.NET

وحدات سيناريو التكوين ASP.NET

موارد أخرى

ملفات التكوين ASP.NET

إعدادات تكوين الـ ASP.NET

إعدادات التكوين العامة (ASP.NET)

تكوين ASP.NET API