InstanceData.InstanceName 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得與這個執行個體資料相關的執行個體名稱。
public:
property System::String ^ InstanceName { System::String ^ get(); };
public string InstanceName { get; }
member this.InstanceName : string
Public ReadOnly Property InstanceName As String
屬性值
與效能計數器相關的執行個體名稱。
範例
下列程式代碼範例會 InstanceData 建立 ,並顯示其 InstanceName 屬性和其他屬性的值。
// Display the contents of an InstanceData object.
public static void ProcessInstanceDataObject(string name, CounterSample CSRef)
{
InstanceData instData = new InstanceData(name, CSRef);
Console.WriteLine(" Data from InstanceData object:\r\n" +
" InstanceName: {0,-31} RawValue: {1}", instData.InstanceName, instData.RawValue);
CounterSample sample = instData.Sample;
Console.WriteLine(" Data from CounterSample object:\r\n" +
" CounterType: {0,-32} SystemFrequency: {1}\r\n" +
" BaseValue: {2,-34} RawValue: {3}\r\n" +
" CounterFrequency: {4,-27} CounterTimeStamp: {5}\r\n" +
" TimeStamp: {6,-34} TimeStamp100nSec: {7}", sample.CounterType, sample.SystemFrequency, sample.BaseValue, sample.RawValue, sample.CounterFrequency, sample.CounterTimeStamp, sample.TimeStamp, sample.TimeStamp100nSec);
}
' Display the contents of an InstanceData object.
Sub ProcessInstanceDataObject(ByVal name As String, _
ByVal CSRef As CounterSample)
Dim instData As New InstanceData(name, CSRef)
Console.WriteLine(" Data from InstanceData object:" & vbCrLf & _
" InstanceName: {0,-31} RawValue: {1}", _
instData.InstanceName, instData.RawValue)
Dim sample As CounterSample = instData.Sample
Console.WriteLine(" Data from CounterSample object:" & vbCrLf & _
" CounterType: {0,-32} SystemFrequency: {1}" & vbCrLf & _
" BaseValue: {2,-34} RawValue: {3}" & vbCrLf & _
" CounterFrequency: {4,-27} CounterTimeStamp: {5}" & vbCrLf & _
" TimeStamp: {6,-34} TimeStamp100nSec: {7}", _
sample.CounterType, sample.SystemFrequency, sample.BaseValue, _
sample.RawValue, sample.CounterFrequency, sample.CounterTimeStamp, _
sample.TimeStamp, sample.TimeStamp100nSec)
End Sub