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 アプリケーションページアプリケーション コンテキスト


このページでは「.NET Framework クラス ライブラリ リファレンス」からHttpRuntimeを検索した結果を表示しています。
Weblioに収録されているすべての辞書からHttpRuntimeを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHttpRuntime を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「HttpRuntime」の関連用語

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

   

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



HttpRuntimeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS