WebMethodAttribute.Description 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
一則描述 XML Web 服務方法的描述性訊息。
public:
property System::String ^ Description { System::String ^ get(); void set(System::String ^ value); };
public string Description { get; set; }
member this.Description : string with get, set
Public Property Description As String
屬性值
一則描述 XML Web 服務方法的描述性訊息。 預設值為 Empty。
範例
在下方範例中,字串 Obtains the Server Computer Name 用於描述 XML Web 服務方法,並於 XML Web 服務的服務描述與服務說明頁面中。
<%@ WebService Language="C#" Class="Util" %>
using System;
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
Imports System.Web.Services
Public Class Util
Inherits WebService
<WebMethod(Description := "Obtains the Server Computer Name", _
EnableSession := False)> _
Public Function GetMachineName() As String
Return Server.MachineName
End Function
End Class
備註
當產生 XML Web 服務的描述文件(如服務描述與服務說明頁)時,描述性訊息會顯示給潛在的 XML Web 服務使用者。