Export (0) Print
Expand All

WebService.Server Property

Gets the HttpServerUtility for the current request.

Namespace: System.Web.Services
Assembly: System.Web.Services (in system.web.services.dll)

public HttpServerUtility Server { get; }
/** @property */
public HttpServerUtility get_Server ()

public function get Server () : HttpServerUtility

Not applicable.

Property Value

An HttpServerUtility object.

The HttpServerUtility class provides several methods that can be used in the processing of Web requests, including CreateObject (for instantiating COM objects).

The example below returns the computer name of the Web server using the Server property.

<%@ 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;
    }
 }
    

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft