Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

HttpRuntime Class

Provides a set of ASP.NET run-time services for the current application.

For a list of all members of this type, see HttpRuntime Members.

System.Object
   System.Web.HttpRuntime

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

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Example

[Visual Basic] 
<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] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.Web

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

Assembly: System.Web (in System.Web.dll)

See Also

HttpRuntime Members | System.Web Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.