Share via


HttpRuntime クラス

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

この型のすべてのメンバの一覧については、HttpRuntime メンバ を参照してください。

System.Object
   System.Web.HttpRuntime

NotInheritable Public Class HttpRuntime
[C#]
public sealed class HttpRuntime
[C++]
public __gc __sealed class HttpRuntime
[JScript]
public class HttpRuntime

スレッドセーフ

この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。

使用例

 
<HTML>
   <HEAD>
      <script language="vb" runat="server">
         Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Dim info As String = ""
            Dim nl As String = "<br>"
        
            info = info + HttpRuntime.AppDomainAppId + nl
            info = info + HttpRuntime.AppDomainAppPath + nl
            info = info + HttpRuntime.AppDomainAppVirtualPath + nl
            info = info + HttpRuntime.AppDomainId + nl
            info = info + HttpRuntime.AspInstallDirectory + nl
            info = info + HttpRuntime.BinDirectory + nl
            info = info + HttpRuntime.ClrInstallDirectory + nl
            info = info + HttpRuntime.CodegenDir + nl
            info = info + HttpRuntime.IsOnUNCShare.ToString() + nl
            info = info + HttpRuntime.MachineConfigurationDirectory + nl
            Response.Write(info)
     End Sub
      </script>
   </HEAD>
  
   <body>
      <form runat="server"></form>
   </body>
</HTML>

[C#] 
<HTML>
   <HEAD>
      <script language="c#" runat="server">
         void Page_Load(Object sender, System.EventArgs e)
         {
            string   info = "";
            string   nl = "<br>";

            info = info + HttpRuntime.AppDomainAppId + nl;
            info = info + HttpRuntime.AppDomainAppPath + nl;
            info = info + HttpRuntime.AppDomainAppVirtualPath + nl;
            info = info + HttpRuntime.AppDomainId + nl;
            info = info + HttpRuntime.AspInstallDirectory + nl;
            info = info + HttpRuntime.BinDirectory + nl;
            info = info + HttpRuntime.ClrInstallDirectory + nl;
            info = info + HttpRuntime.CodegenDir + nl;
            info = info + HttpRuntime.IsOnUNCShare.ToString() + nl;
            info = info + HttpRuntime.MachineConfigurationDirectory + nl;
            Response.Write(info);
         }
      </script>
   </HEAD>
  
   <body>    
      <form runat="server"></form>
   </body>
</HTML>

[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

名前空間: System.Web

プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ

アセンブリ: System.Web (System.Web.dll 内)

参照

HttpRuntime メンバ | System.Web 名前空間