共用方式為


WebApplicationInformation.MachineName 屬性

定義

取得應用程式電腦名稱。

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

屬性值

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

適用於