DataCollection.CurrentId 속성

CurrentId 속성은 NameProfile, StartProfile, StopProfile, SuspendProfile 및 ResumeProfile에 대한 호출에서 스레드 ID 또는 프로세스 ID에 대해 의사(pseudo) 토큰을 반환합니다.이 속성을 사용하면 메서드는 구체적으로 지정된 스레드나 프로세스 대신 현재 스레드나 프로세스에 대해 작업합니다.

네임스페이스:  Microsoft.VisualStudio.Profiler
어셈블리:  Microsoft.VisualStudio.Profiler(Microsoft.VisualStudio.Profiler.dll)

구문

‘선언
Public Shared ReadOnly Property CurrentId As UInteger
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
프로세스 또는 스레드 식별자에 대한 부호 없는 정수 값입니다.

예제

다음 코드 예제에서는 CurrentId 속성을 보여 줍니다.CurrentId는 현재 스레드 ID를 식별하기 위해 DataCollection.NameProfile 호출에 매개 변수로 전달됩니다.

        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 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

DataCollection 클래스

Microsoft.VisualStudio.Profiler 네임스페이스