Compartir a través de


WebService.Server Propiedad

Definición

Obtiene el valor de la clase HttpServerUtility para la solicitud actual.

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

Valor de propiedad

HttpServerUtility

Un objeto HttpServerUtility.

Atributos

Ejemplos

En el ejemplo siguiente se devuelve el nombre de equipo del servidor web mediante la Server propiedad .

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

Comentarios

La HttpServerUtility clase proporciona varios métodos que se pueden usar en el procesamiento de solicitudes web, incluidos CreateObject (para crear instancias de objetos COM).

Se aplica a

Consulte también