Właściwość Cpu.GroupID
Pobiera bieżącą wartość GroupID element członkowski.
Przestrzeń nazw: Microsoft.SqlServer.Management.Smo
Zestaw: Microsoft.SqlServer.Smo (w Microsoft.SqlServer.Smo.dll)
Składnia
'Deklaracja
Public ReadOnly Property GroupID As Integer
Get
'Użycie
Dim instance As Cpu
Dim value As Integer
value = instance.GroupID
public int GroupID { get; }
public:
property int GroupID {
int get ();
}
member GroupID : int
function get GroupID () : int
Wartość właściwości
Typ: System.Int32
Zwraca IdentyfikatorGrupy przypisane do tego Cpu obiektu.
Uwagi
Procesory w systemie komputerowym są ułożone w grupy.Każda grupa jest identyfikowany przez identyfikator GroupID, przypisany przez sprzęt komputera.
Przykłady
Poniższy przykład kodu pokazuje sposób wyświetlania IdentyfikatorGrupy dla każdego Procesora w lokalne wystąpienie SQL Server.
C#
using System;
using Microsoft.SqlServer.Management.Smo;
namespace samples
{
class Program
{
static void Main(string[] args)
{
Server dbServer = new Server("(local)");
dbServer.Refresh();
foreach (Cpu cpu in dbServer.AffinityInfo.Cpus)
{
Console.WriteLine("CPU ID {0} is {1}.",
cpu.ID, cpu.GroupID);
}
}
}
}
PowerShell
$dbServer = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$dbServer.Refresh()
Foreach ($cpu in $dbServer.AffinityInfo.Cpus)
{
Write-Host "CPU ID:" $cpu.ID "is" $cpu.GroupID
}