HttpRuntimeとは? わかりやすく解説

HttpRuntime クラス

現在のアプリケーションに ASP.NET ランタイム サービスのセットを提供します。

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 HttpRuntime
public sealed class HttpRuntime
public ref class HttpRuntime sealed
public final class HttpRuntime
解説解説
使用例使用例

現在のアプリケーション ドメインを表す、HttpRuntime クラスのプロパティを取得して、それをブラウザに表示する方法を次のコード例に示します。

<%@ Page Language="VB" %>
<script runat="server">

  Protected Sub Page_Load(ByVal
 sender As Object, ByVal
 e As System.EventArgs)
    
    Dim sb As New StringBuilder()
    Dim nl As String = "<br>"

    sb.Append("AppDomainAppId = " & _
      HttpRuntime.AppDomainAppId & nl)
    sb.Append("AppDomainAppPath = " & _
      HttpRuntime.AppDomainAppPath & nl)
    sb.Append("AppDomainAppVirtualPath = " & _
      HttpRuntime.AppDomainAppVirtualPath & nl)
    sb.Append("AppDomainId = " & _
      HttpRuntime.AppDomainId & nl)
    sb.Append("AspInstallDirectory = " & _
      HttpRuntime.AspInstallDirectory & nl)
    sb.Append("BinDirectory = " & _
      HttpRuntime.BinDirectory & nl)
    sb.Append("ClrInstallDirectory = " & _
      HttpRuntime.ClrInstallDirectory & nl)
    sb.Append("CodegenDir = " & _
      HttpRuntime.CodegenDir & nl)
    sb.Append("IsOnUNCShare = " & _
      HttpRuntime.IsOnUNCShare.ToString() & nl)
    sb.Append("MachineConfigurationDirectory = " &
 _
      HttpRuntime.MachineConfigurationDirectory & nl)

    label1.Text = sb.ToString()

  End Sub
</script>
<html>
  <head>
    <title>HttpRuntime Example</title>
  </head>
  <body>    
    <form id="Form1" runat="server">
      <asp:label id="label1" runat="server"/>
    </form>
  </body>
</html>
<%@ Page Language="C#" %>
<script runat="server">

  void Page_Load(Object sender, System.EventArgs e)
  {
    StringBuilder sb = new StringBuilder();
    String nl = "<br>";

    sb.Append("AppDomainAppId = " + 
      HttpRuntime.AppDomainAppId + nl);
    sb.Append("AppDomainAppPath = " + 
      HttpRuntime.AppDomainAppPath + nl);
    sb.Append("AppDomainAppVirtualPath = " + 
      HttpRuntime.AppDomainAppVirtualPath + nl);
    sb.Append("AppDomainId = " + 
      HttpRuntime.AppDomainId + nl);
    sb.Append("AspInstallDirectory = " + 
      HttpRuntime.AspInstallDirectory + nl);
    sb.Append("BinDirectory = " + 
      HttpRuntime.BinDirectory + nl);
    sb.Append("ClrInstallDirectory = " + 
      HttpRuntime.ClrInstallDirectory + nl);
    sb.Append("CodegenDir = " + 
      HttpRuntime.CodegenDir + nl);
    sb.Append("IsOnUNCShare = " + 
      HttpRuntime.IsOnUNCShare.ToString() + nl);
    sb.Append("MachineConfigurationDirectory = " + 
      HttpRuntime.MachineConfigurationDirectory + nl);

    label1.Text = sb.ToString();
  }

</script>
<html>
  <head>
    <title>HttpRuntime Example</title>
  </head>
  <body>    
    <form runat="server">
      <asp:label id="label1" runat="server"/>
    </form>
  </body>
</html>
<%@ Page Language="VJ#"%>
<script runat="server">

  void Page_Load(Object sender, System.EventArgs e)
  {
    StringBuilder sb = new StringBuilder();
    String nl = "<br>";

    sb.Append("AppDomainAppId = " + 
      HttpRuntime.get_AppDomainAppId() + nl);
    sb.Append("AppDomainAppPath = " + 
      HttpRuntime.get_AppDomainAppPath() + nl);
    sb.Append("AppDomainAppVirtualPath = " + 
      HttpRuntime.get_AppDomainAppVirtualPath() + nl);
    sb.Append("AppDomainId = " + 
      HttpRuntime.get_AppDomainId() + nl);
    sb.Append("AspInstallDirectory = " + 
      HttpRuntime.get_AspInstallDirectory() + nl);
    sb.Append("BinDirectory = " + 
      HttpRuntime.get_BinDirectory() + nl);
    sb.Append("ClrInstallDirectory = " + 
      HttpRuntime.get_ClrInstallDirectory() + nl);
    sb.Append("CodegenDir = " + 
      HttpRuntime.get_CodegenDir() + nl);
    sb.Append("IsOnUNCShare = " + 
      Convert.ToString(HttpRuntime.get_IsOnUNCShare()) + nl);
    sb.Append("MachineConfigurationDirectory = " + 
      HttpRuntime.get_MachineConfigurationDirectory() + nl);

    label1.set_Text(sb.ToString());
  }

</script>
<html>
  <head>
    <title>HttpRuntime Example</title>
  </head>
  <body>    
    <form id="Form1" runat="server">
      <asp:label id="label1" runat="server"/>
    </form>
  </body>
</html>
.NET Framework のセキュリティ.NET Framework のセキュリティ
継承階層継承階層
System.Object
  System.Web.HttpRuntime
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

HttpRuntime コンストラクタ


HttpRuntime プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ AppDomainAppId HttpRuntime が存在するアプリケーション ドメインのアプリケーション ID を取得します。
パブリック プロパティ AppDomainAppPath 現在のアプリケーション ドメインでホストされるアプリケーションのアプリケーション ディレクトリの物理ドライブ パスを取得します。
パブリック プロパティ AppDomainAppVirtualPath 現在のアプリケーション ドメインでホストされる、アプリケーションを格納するディレクトリの仮想パスを取得します。
パブリック プロパティ AppDomainId HttpRuntime が存在するアプリケーション ドメインのアプリケーション ID を取得します。
パブリック プロパティ AspClientScriptPhysicalPath ASP.NET クライアント スクリプト ファイルのフォルダ パスを取得します。
パブリック プロパティ AspClientScriptVirtualPath ASP.NET クライアント スクリプト ファイルの仮想パスを取得します。
パブリック プロパティ AspInstallDirectory ASP.NET 実行可能ファイルがインストールされているディレクトリの物理パスを取得します。
パブリック プロパティ BinDirectory 現在のアプリケーションの /bin ディレクトリへの物理パスを取得します。
パブリック プロパティ Cache 現在のアプリケーションに対する Cache を取得します。
パブリック プロパティ ClrInstallDirectory 共通言語ランタイムの実行可能ファイルをインストールするディレクトリを表す物理パスを取得します。
パブリック プロパティ CodegenDir 生成されたソース、コンパイルされたアセンブリなどの現在のアプリケーションの一時ファイルを ASP.NET で格納する場合に使用する、ディレクトリを表す物理パスを取得します。
パブリック プロパティ IsOnUNCShare アプリケーションを UNC (universal naming convention) 共有に割り当てるかどうかを示す値を取得します。
パブリック プロパティ MachineConfigurationDirectory 現在のアプリケーションの Machine.config ファイルを格納するディレクトリを表す物理パスを取得します。
参照参照

関連項目

HttpRuntime クラス
System.Web 名前空間
ProcessRequest
HttpWorkerRequest
SimpleWorkerRequest

その他の技術情報

ASP.NET Web アプリケーションのページとアプリケーション コンテキスト

HttpRuntime メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

HttpRuntime クラス
System.Web 名前空間
ProcessRequest
HttpWorkerRequest
SimpleWorkerRequest

その他の技術情報

ASP.NET Web アプリケーションのページとアプリケーション コンテキスト

HttpRuntime メンバ

現在のアプリケーションに ASP.NET ランタイム サービスのセットを提供します。

HttpRuntime データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド HttpRuntime HttpRuntime クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ AppDomainAppId HttpRuntime が存在するアプリケーション ドメインのアプリケーション ID を取得します。
パブリック プロパティ AppDomainAppPath 現在のアプリケーション ドメインでホストされるアプリケーションのアプリケーション ディレクトリの物理ドライブ パスを取得します。
パブリック プロパティ AppDomainAppVirtualPath 現在のアプリケーション ドメインでホストされる、アプリケーションを格納するディレクトリの仮想パスを取得します。
パブリック プロパティ AppDomainId HttpRuntime が存在するアプリケーション ドメインのアプリケーション ID を取得します。
パブリック プロパティ AspClientScriptPhysicalPath ASP.NET クライアント スクリプト ファイルのフォルダ パスを取得します。
パブリック プロパティ AspClientScriptVirtualPath ASP.NET クライアント スクリプト ファイルの仮想パスを取得します。
パブリック プロパティ AspInstallDirectory ASP.NET 実行可能ファイルがインストールされているディレクトリの物理パスを取得します。
パブリック プロパティ BinDirectory 現在のアプリケーションの /bin ディレクトリへの物理パスを取得します。
パブリック プロパティ Cache 現在のアプリケーションに対する Cache を取得します。
パブリック プロパティ ClrInstallDirectory 共通言語ランタイムの実行可能ファイルをインストールするディレクトリを表す物理パスを取得します。
パブリック プロパティ CodegenDir 生成されたソース、コンパイルされたアセンブリなどの現在のアプリケーションの一時ファイルを ASP.NET で格納する場合に使用する、ディレクトリを表す物理パスを取得します。
パブリック プロパティ IsOnUNCShare アプリケーションを UNC (universal naming convention) 共有に割り当てるかどうかを示す値を取得します。
パブリック プロパティ MachineConfigurationDirectory 現在のアプリケーションの Machine.config ファイルを格納するディレクトリを表す物理パスを取得します。
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

HttpRuntime クラス
System.Web 名前空間
ProcessRequest
HttpWorkerRequest
SimpleWorkerRequest

その他の技術情報

ASP.NET Web アプリケーションのページとアプリケーション コンテキスト



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「HttpRuntime」の関連用語

HttpRuntimeのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HttpRuntimeのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS