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) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「HttpRuntime クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS