語言

WebApplicationInformation.MachineName 屬性

定義

取得應用程式機器名稱。

public:
 property System::String ^ MachineName { System::String ^ get(); };
public string MachineName { get; }
member this.MachineName : string
Public ReadOnly Property MachineName As String

屬性值

應用程式正在執行的機器名稱。

範例

以下程式碼範例說明如何取得機器名稱。

public string GetApplicationMachineName()
{
    // Get the name of the application machine name.
    return (string.Format(
        "Application machine name: {0}",
        ApplicationInformation.MachineName));
}
Public Function GetApplicationMachineName() As String
    ' Get the name of the application machine name.
    Return String.Format( _
    "Application machine name: {0}", _
    ApplicationInformation.MachineName())
End Function 'GetApplicationMachineName

適用於