共用方式為


Cpu.GroupID 屬性

Gets the current value of the GroupID member.

命名空間:  Microsoft.SqlServer.Management.Smo
組件:  Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)

語法

'宣告
Public ReadOnly Property GroupID As Integer 
    Get
'用途
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

屬性值

型別:System.Int32
Returns the GroupID that is assigned to this Cpu object.

備註

CPUs in a computer system are arranged into groups. Each group is identified by a GroupID that is assigned by the computer hardware.

範例

The following code example shows how to display the GroupID for each CPU on the local instance of 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
}

請參閱

參考

Cpu 類別

Microsoft.SqlServer.Management.Smo 命名空間