Udostępnij przez


Właściwość Computer.Name

Pobiera nazwę komputera.

Przestrzeń nazw:  Microsoft.SqlServer.Management.Utility
Zestaw:  Microsoft.SqlServer.Management.Utility (w Microsoft.SqlServer.Management.Utility.dll)

Składnia

'Deklaracja
<SfcPropertyAttribute> _
<SfcKeyAttribute()> _
Public ReadOnly Property Name As String
    Get
'Użycie
Dim instance As Computer
Dim value As String

value = instance.Name
[SfcPropertyAttribute]
[SfcKeyAttribute()]
public string Name { get; }
[SfcPropertyAttribute]
[SfcKeyAttribute()]
public:
property String^ Name {
    String^ get ();
}
[<SfcPropertyAttribute>]
[<SfcKeyAttribute()>]
member Name : string
function get Name () : String

Wartość właściwości

Typ: System.String
A String wartość, która określa nazwę komputera.

Przykłady

VC #

System.Console.WriteLine(computer.Name);

VB

System.Console.WriteLine(computer.Name)

PowerShell

Write-Host $computer.Name