HttpRequest クラス

ワーカー プロセスでの HTTP 要求を表します。

構文

class HttpRequest : Object  

メソッド

このクラスにはメソッドが含まれていません。

プロパティ

次の表は、HttpRequest クラスによって公開されるプロパティの一覧です。

名前 説明
ClientIPAddress 要求を行ったクライアントの IP アドレスを含む、読み取り専用の string 値。
ConnectionId 要求の接続を一意に識別する 128 ビットの GUID を含む、読み取り専用の string 値。
CurrentModule 要求が実行されている現在のモジュールの名前を含む、読み取り専用の string 値。
HostName クライアントが要求したサイトのドメイン名またはコンピューター名を含む、読み取り専用の string 値。
GUID 要求を一意に識別する 128 ビットの GUID を含む、読み取り専用の string 値。 唯一のキー プロパティ。
LocalIPAddress 要求を受信したネットワーク アダプターの IP アドレスを含む、読み取り専用の string 値。
LocalPort 要求を受信したポート番号を含む、読み取り専用の uint32 値。
PipelineState 要求が実行されているパイプライン モジュールの状態を含む、読み取り専用の uint32 値。 使用可能な値は、「要求処理定数」に記載されています。
SiteId 要求のサイト ID を含む、読み取り専用の uint32 値。
TimeElapsed 要求が処理されている期間 (ミリ秒単位) を含む、読み取り専用の uint32 値。
TimeInModule 要求が現在実行されているモジュール内にいる期間 (ミリ秒単位) を含む、読み取り専用の uint32 値。
TimeInState 要求が現在の要求の通知状態になっている期間 (ミリ秒単位) を含む、読み取り専用の uint32 値。
Url 要求された URL を含む、読み取り専用の string 値。
Verb 要求で使用されている HTTP 動詞を含む、読み取り専用の string 値。

サブクラス

このクラスにはサブクラスが含まれていません。

解説

次の例は、Web サーバーで現在実行されている各要求のすべてのプロパティを一覧表示します。

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the worker processes.  
Set oW3WPs = oWebAdmin.InstancesOf("WorkerProcess")  
  
For Each oW3WP In oW3WPs  
  
    ' Get the requests queued for an individual worker process and  
    ' place them in an array.  
    oW3WP.GetExecutingRequests arrReqs  
  
    ' Show the number of requests queued.  
    If IsNull(arrReqs) Then  
                WScript.Echo "No currently executing requests."  
    Else  
  
        WScript.Echo "Number of currently executing requests: " & _  
            UBound(arrReqs) + 1  
        WScript.Echo  
  
        For Each oRequest In arrReqs  
            WScript.Echo "ClientIPAddress: " & oRequest.ClientIPAddress  
            WScript.Echo "ConnectionId: " & oRequest.ConnectionId  
            WScript.Echo "CurrentModule: " & oRequest.CurrentModule  
            WScript.Echo "GUID: "  &  oRequest.GUID  
            WScript.Echo "HostName: " & oRequest.HostName  
            WScript.Echo "LocalIPAddress: " &  oRequest.LocalIPAddress  
            WScript.Echo "LocalPort: " &  oRequest.LocalPort  
            WScript.Echo "PipelineState: " &  oRequest.PipelineState  
            WScript.Echo "Site ID: " &  oRequest.SiteID  
            WScript.Echo "TimeElapsed: " &  oRequest.TimeElapsed  
            WScript.Echo "TimeInModule: " &  oRequest.TimeInModule  
            WScript.Echo "TimeInState: " &  oRequest.TimeInState  
            WScript.Echo "Url: "  & oRequest.Url  
            WScript.Echo "Verb: " &  oRequest.Verb  
            WScript.Echo  
        Next  
    End If  
Next  
  

継承階層

Object

HttpRequest

要件

説明
クライアント - Windows Vista 上の IIS 7.0
- Windows 7 上の IIS 7.5
- Windows 8 上の IIS 8.0
- Windows 10 上の IIS 10.0
[サーバー] - Windows Server 2008 上の IIS 7.0
- Windows Server 2008 R2 上の IIS 7.5
- Windows Server 2012 上の IIS 8.0
- Windows Server 2012 R2 上の IIS 8.5
- Windows Server 2016 上の IIS 10.0
Product - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
MOF ファイル WebAdministration.mof

参照

要求処理定数
Object クラス
ワーカー プロセスで現在実行中の要求を表示する