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
Get
public static uint CurrentId { get; }
public:
static property unsigned int CurrentId {
unsigned int get ();
}
static member CurrentId : uint32
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);
}
.NET Framework セキュリティ
- 直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「部分信頼コードからのライブラリの使用」を参照してください。