DataCollection.CurrentId プロパティ

更新 : 2007 年 11 月

CurrentId プロパティは、NameProfile、StartProfile、StopProfile、SuspendProfile、および ResumeProfile への呼び出しでスレッド ID またはプロセス ID の疑似トークンを返します。指定されたスレッドやプロセスではなく、現在のスレッドまたはプロセスでメソッドを実行する場合に、このプロパティを使用します。

名前空間 :  Microsoft.VisualStudio.Profiler
アセンブリ :  Microsoft.VisualStudio.Profiler (Microsoft.VisualStudio.Profiler.dll 内)

構文

'宣言
Public Shared ReadOnly Property CurrentId As UInteger
'使用
Dim value As UInteger

value = DataCollection.CurrentId
public static uint CurrentId { get; }
public:
static property unsigned int CurrentId {
    unsigned int get ();
}
public static function get CurrentId () : uint

プロパティ値

型 : System.UInt32

プロセス ID またはスレッド ID を表す符号なし整数値。

CurrentId プロパティのコード例を次に示します。DataCollection.NameProfile 呼び出しのパラメータに CurrentId を渡すことにより、現在のスレッドの ID を識別します。

        public void ExerciseCommentMarkAtProfile()
        {
            // Declare and initalize variables to pass to 
            // CommentMarkAtProfile.  The values of these 
            // parameters are assigned based on the needs 
            // of the code; and for the sake of simplicity
            // in this example, the variables are assigned
            // arbitrary values.
            long timestamp = 0x1111;
            int markId = 01;
            string markText = "Exercising CommentMarkAtProfile...";

            // Declare MarkOperationResult Enumerator.  
            // Holds return value from call to CommentMarkAtProfile.
            MarkOperationResult markResult;

            markResult = DataCollection.CommentMarkAtProfile(
                timestamp,
                markId,
                markText);

            // Check result of CommentMarkAtProfile call.
            Console.WriteLine("CommentMarkAtProfile returned {0}",
                markResult); 
        }

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

DataCollection クラス

DataCollection メンバ

Microsoft.VisualStudio.Profiler 名前空間