HttpRuntime 클래스

정의

현재 애플리케이션에 ASP.NET 런타임 서비스 집합을 제공합니다.

public ref class HttpRuntime sealed
public sealed class HttpRuntime
type HttpRuntime = class
Public NotInheritable Class HttpRuntime
상속
HttpRuntime

예제

다음 예제에서는 속성을 가져오지는 HttpRuntime 현재 애플리케이션 도메인을 나타내는 클래스 및 브라우저에 표시 합니다.

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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 xmlns="http://www.w3.org/1999/xhtml" >
  <head>
    <title>HttpRuntime Example</title>
  </head>
  <body>    
    <form id="form1" runat="server">
      <asp:label id="label1" runat="server"/>
    </form>
  </body>
</html>
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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 xmlns="http://www.w3.org/1999/xhtml" >
  <head>
    <title>HttpRuntime Example</title>
  </head>
  <body>    
    <form id="Form1" runat="server">
      <asp:label id="label1" runat="server"/>
    </form>
  </body>
</html>

설명

개체는 HttpRuntime HTTP 요청을 처리하는 ASP.NET 파이프라인 모델의 시작 부분에서 사용됩니다. 메서드는 ProcessRequest 모든 후속 ASP.NET 웹 처리를 구동합니다.

페이지 개발자가 사용할 수는 HttpRuntime 클래스 속성을 예를 들어 진단 목적을 위해 현재 애플리케이션 도메인에 대 한 정보 찾기. 사용자 지정 프로세스 파이프라인 또는 사용자 지정 호스팅 환경을 만드는 개발자는 또는 SimpleWorkerRequest 클래스에서 파생된 클래스에서 메서드를 HttpWorkerRequest 호출 ProcessRequest 해야 합니다.

생성자

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이 현재 애플리케이션에 대한 임시 파일(생성된 소스, 컴파일된 어셈블리 등)을 저장하는 디렉터리의 실제 경로를 가져옵니다.

IISVersion

이 애플리케이션을 호스팅하는 IIS의 버전을 가져옵니다.

IsOnUNCShare

애플리케이션이 UNC(Universal Naming Convention) 공유로 매핑되는지 여부를 나타내는 값을 가져옵니다.

MachineConfigurationDirectory

현재 애플리케이션에 대한 Machine.config 파일이 있는 디렉터리의 실제 경로를 가져옵니다.

TargetFramework

현재 웹 애플리케이션의 대상이 되는 .NET Framework 버전을 가져옵니다.

UsingIntegratedPipeline

현재 애플리케이션이 IIS 7.0의 통합 파이프라인 모드에서 실행 중인지 여부를 나타내는 값을 가져옵니다.

WebObjectActivator

종속성 주입 지원에 대한 IServiceProvider 인스턴스를 가져오거나 설정합니다.

메서드

Close()

HttpRuntime 인스턴스를 종료합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetNamedPermissionSet()

코드 그룹과 연결된 권한 집합을 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ProcessRequest(HttpWorkerRequest)

모든 ASP.NET 웹 처리 작업을 실행합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)
UnloadAppDomain()

현재 애플리케이션을 종료합니다. 애플리케이션은 해당 요청을 받는 다음 번에 다시 시작됩니다.

적용 대상

추가 정보