WebService.Server 속성

정의

HttpServerUtility 현재 요청에 대한 값을 가져옵니다.

public:
 property System::Web::HttpServerUtility ^ Server { System::Web::HttpServerUtility ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Web.HttpServerUtility Server { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Server : System.Web.HttpServerUtility
Public ReadOnly Property Server As HttpServerUtility

속성 값

HttpServerUtility 개체입니다.

특성

예제

아래 예제에서는 속성을 사용하여 웹 서버의 컴퓨터 이름을 반환합니다 Server .

<%@ WebService Language="C#" Class="Util" %>
 
 using System.Web.Services;
 
 public class Util: WebService {
    [ WebMethod(Description="Obtains the Server Computer Name",EnableSession=false)]
    public string GetMachineName() {
       return Server.MachineName;
    }
 }
<%@ WebService Language="VB" Class="Util" %> 

Imports System.Web.Services

Public Class Util
    Inherits WebService
    
    <WebMethod(Description := "Obtains the Computer Machine Name", _
        EnableSession := False)> _
    Public Function GetMachineName() As String
        
        Return Server.MachineName
    End Function
End Class

설명

이 클래스는 HttpServerUtility COM 개체 인스턴스화를 포함하여 CreateObject 웹 요청 처리에 사용할 수 있는 몇 가지 메서드를 제공합니다.

적용 대상

추가 정보