Condividi tramite


Classe RequestFilteringSection

Configura l'analisi delle richieste URL in ingresso.

Sintassi

class RequestFilteringSection : ConfigurationSectionWithCollection  

Metodi

Nella tabella seguente sono elencati i metodi esposti dalla RequestFilteringSection classe .

Nome Descrizione
Aggiungere Ereditato da ConfigurationSectionWithCollection.
Cancella Ereditato da ConfigurationSectionWithCollection.
Recupero Ereditato da ConfigurationSectionWithCollection.
GetAllowDefinition Ereditato da ConfigurationSection.
GetAllowLocation Ereditato da ConfigurationSection.
Rimuovi Ereditato da ConfigurationSectionWithCollection.
RevertToParent Ereditato da ConfigurationSection.
SetAllowDefinition Ereditato da ConfigurationSection.
SetAllowLocation Ereditato da ConfigurationSection.

Proprietà

Nella tabella seguente sono elencate le proprietà esposte dalla RequestFilteringSection classe .

Nome Descrizione
AllowDoubleEscaping Valore di lettura/scrittura boolean . true se i caratteri di escape doppio sono consentiti negli URL; in caso contrario, false. Il valore predefinito è false.
AllowHighBitCharacters Valore di lettura/scrittura boolean . true se i caratteri non ASCII sono consentiti negli URL; in caso contrario, false. Il valore predefinito è true.
DenyUrlSequences Valore UrlSequenceSettings che contiene sequenze DI URL che possono essere usate per attaccare un server Web e, pertanto, verrà negato.
FileExtensions Valore FileExtensionsSettings di lettura/scrittura che specifica le estensioni di file che possono essere consentite o negate in una richiesta.
HiddenSegments Valore HiddenSegmentSettings che specifica i segmenti i cui contenuti non verranno serviti al client. Nota: Un segmento fa parte di un URL tra due barre o la parte dell'URL che segue l'ultima barra. Ad esempio, l'URL /segment1/segment2/segment3.asp include tre segmenti: segment1, segment2 e segment3.asp. Nota: Per impostazione predefinita, i segmenti seguenti sono bloccati: bin, App_code, App_GlobalResources, App_LocalResources, App_WebReferences, App_Data e App_Browsers.
Location Ereditato da ConfigurationSection.) Proprietà chiave.
Path Ereditato da ConfigurationSection.) Proprietà chiave.
RequestLimits Valore RequestLimitsElement che specifica i limiti di dimensione per le richieste HTTP in ingresso.
SectionInformation Ereditato da ConfigurationSection.
Verbs Valore VerbsSettings di lettura/scrittura che specifica i verbi HTTP per consentire o negare. Nota: I caratteri jolly per i verbi HTTP non sono supportati.

Sottoclassi

Questa classe non contiene sottoclassi.

Commenti

Questa classe si integra in IIS 7 la funzionalità dello strumento URLScan usato dalle versioni precedenti di IIS.

Nota

Per il funzionamento della funzionalità nella RequestFilteringSection classe, è necessario installare il modulo di filtro richieste (Modrqflt.dll).

Esempio

L'esempio seguente mostra tutte le proprietà per la sezione di filtro delle richieste nel file di ApplicationHost.config.

' Connect to the WMI WebAdministration namespace.  
Set objWMIService = GetObject("winmgmts:root\WebAdministration")  
  
' Get the request-filtering section.  
Set oRequestFilteringSection = objWMIService.Get( _  
"RequestFilteringSection.Path='MACHINE/WEBROOT/APPHOST',Location=''")  
  
' Show the path.  
WScript.Echo "[Request Filtering Path]"  
WScript.Echo oRequestFilteringSection.Path_  
WScript.Echo   
  
' Show the AllowDoubleEscaping property as "True" or "False."  
WScript.Echo "[AllowDoubleEscaping]"  
WScript.Echo CStr(oRequestFilteringSection.AllowDoubleEscaping)  
WScript.Echo   
  
' Show the AllowHighBitCharacters property as "True" or "False."  
WScript.Echo "[AllowHighBitCharacters]"  
WScript.Echo CStr(oRequestFilteringSection.AllowHighBitCharacters)  
WScript.Echo   
  
' List the denied URL sequences.  
WScript.Echo "[Denied Url Sequences]"  
For Each oSequence In _  
    oRequestFilteringSection.DenyUrlSequences.DenyUrlSequences  
    WScript.Echo oSequence.Sequence  
Next  
WScript.Echo   
  
' List the file extensions settings.  
WScript.Echo "[File Extensions]"  
  
' Show the AllowUnlisted property as "True" or "False."  
WScript.Echo "Allow unlisted file extensions: " & _  
    oRequestFilteringSection.FileExtensions.AllowUnlisted  
WScript.Echo  
  
' List each file extension and show whether it is allowed.  
For Each oFileExtension In _  
    oRequestFilteringSection.FileExtensions.FileExtensions  
    WScript.Echo "File extension: " & oFileExtension.FileExtension  
    WScript.Echo "File extension allowed: " & oFileExtension.Allowed  
    WScript.Echo  
Next  
WScript.Echo   
  
' List the hidden segments.  
WScript.Echo "[Hidden Segments]"  
For Each oHiddenSegment In _  
    oRequestFilteringSection.HiddenSegments.HiddenSegments  
    WScript.Echo oHiddenSegment.Segment  
Next  
WScript.Echo   
  
' Show the request limits settings.  
WScript.Echo "[Request Limits]"  
WScript.Echo "maxAllowedContentLength: " & _  
oRequestFilteringSection.RequestLimits.maxAllowedContentLength  
WScript.Echo "maxUrl: " & oRequestFilteringSection.RequestLimits.maxUrl  
WScript.Echo "maxQueryString: " & oRequestFilteringSection.RequestLimits.maxQueryString  
WScript.Echo   
  
' Show the header limits settings.  
WScript.Echo vbtab & "[Header Limits]"  
For Each oHeaderLimit In _  
    oRequestFilteringSection.RequestLimits.HeaderLimits.HeaderLimits  
    WScript.Echo vbtab & "Header: " & oHeaderLimit.Header  
    WScript.Echo vbtab & "Header size limit: " & oHeaderLimit.SizeLimit  
    WScript.Echo   
Next  
  
' List the verbs settings.  
WScript.Echo "[Verbs]"  
WScript.Echo "Allow unlisted verbs: " & oRequestFilteringSection.Verbs.AllowUnlisted  
WScript.Echo   
  
' List each verb and show whether it is allowed.  
For Each oVerb In oRequestFilteringSection.Verbs.Verbs  
    WScript.Echo "Verb: " & oVerb.Verb  
    WScript.Echo "Verb allowed: " & oVerb.Allowed  
    WScript.Echo  
Next  
  

Gerarchia di ereditarietà

Configurationsection

ConfigurationSectionWithCollection

RequestFilteringSection

Requisiti

Tipo Descrizione
Client - IIS 7.0 in Windows Vista
- IIS 7.5 in Windows 7
- IIS 8.0 in Windows 8
- IIS 10.0 in Windows 10
Server - IIS 7.0 in Windows Server 2008
- IIS 7.5 in Windows Server 2008 R2
- IIS 8.0 in Windows Server 2012
- IIS 8.5 in Windows Server 2012 R2
- IIS 10.0 in Windows Server 2016
Prodotto - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
File MOF WebAdministration.mof

Vedere anche

Classe ConfigurationSectionWithCollection
Classe FileExtensionElement
Classe FileExtensionsSettings
Classe HeaderLimitsSettings
Classe HiddenSegmentSettings
<requestFiltering>
Classe RequestLimitsElement
Classe UrlSequence
Classe UrlSequenceSettings
Classe VerbElement
Classe VerbsSettings