WebService.Server 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
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 웹 요청 처리에 사용할 수 있는 몇 가지 메서드를 제공합니다.