Process.ProcessID الخاصية
يحصل على رقم المعرف Win32 المعينة لهذا عملية.
مساحة الاسم: EnvDTE
التجميع: EnvDTE (في EnvDTE.dll)
بناء الجملة
'إقرار
ReadOnly Property ProcessID As Integer
Get
int ProcessID { get; }
property int ProcessID {
int get ();
}
abstract ProcessID : int
function get ProcessID () : int
قيمة الخاصية
النوع: System.Int32
عدد صحيح يمثل رقم المعرف Win32 المعينة لهذا عملية.
أمثلة
يوضح المثال التالي كيفية إلى تستخدم في ProcessIDخاصية.
لاختبار هذه خاصية
قم بتعيين نقطة توقف في تطبيق الهدف.
قم بتشغيل تطبيق الهدف في الوضع التصحيح.
عند إيقاف تشغيل تطبيق على نقطة الإيقاف، قم بتشغيل الوظيفة الإضافية.
public static void ProcessID(DTE dte)
{
// Setup debug Output window.
Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
w.Visible = true;
OutputWindow ow = (OutputWindow)w.Object;
OutputWindowPane owp = ow.OutputWindowPanes.Add("ProcessID Property Test");
owp.Activate();
owp.OutputString("\nEdition of the environment: " +
dte.Debugger.DebuggedProcesses.Item(1).DTE.Edition);
owp.OutputString("\nThe name of the current program: " +
dte.Debugger.DebuggedProcesses.Item(1).Name);
owp.OutputString("\nThe name of the current program: " +
dte.Debugger.DebuggedProcesses.Item(1).Parent.CurrentProgram.Name);
owp.OutputString("\nProcess ID: " +
dte.Debugger.DebuggedProcesses.Item(1).ProcessID);
EnvDTE.Programs programs =
dte.Debugger.DebuggedProcesses.Item(1).Programs;
owp.OutputString("\nThe name of the current program: " +
programs.Item(1).Name);
}
Shared Sub ProcessID(ByRef dte As EnvDTE.DTE)
Dim str As String
Dim processes As EnvDTE.Processes = dte.Debugger.DebuggedProcesses
str = "Edition of the environment: " + processes.Item(1).DTE.Edition
str += vbCrLf + "The name of the current program: " + _
processes.Item(1).Name
str += vbCrLf + "The name of the current program: " + _
processes.Item(1).Parent.CurrentProgram.Name
str += vbCrLf + "Process ID: " + processes.Item(1).ProcessID.ToString()
str += vbCrLf + "The name of the current program: " + _
processes.Item(1).Programs.Item(1).Name
MessageBox.Show(str, "ProcessID Property Test")
End Sub
أمن NET Framework.
- الثقة الكاملة للمتصل الفوري. يتعذر استخدام هذا العضو بواسطة التعليمات البرمجية الموثوق بها جزئيًا. لمزيد من المعلومات، راجع باستخدام مكتبات من تعليمات برمجية موثوق بها جزئي.