Debugger3.LocalProcesses Özellik
O şu anda bu bilgisayarda çalışan işlemlerin listesini alır.
Ad alanı: EnvDTE90
Derleme: EnvDTE90 (EnvDTE90.dll içinde)
Sözdizimi
'Bildirim
ReadOnly Property LocalProcesses As Processes
Get
Processes LocalProcesses { get; }
property Processes^ LocalProcesses {
Processes^ get ();
}
abstract LocalProcesses : Processes
function get LocalProcesses () : Processes
Özellik Değeri
Tür: EnvDTE.Processes
A Processes koleksiyonu.
Yüklenen
Açıklamalar
LocalProcessesalır bir Processes Bu bilgisayar çalışan işlemlerin listesini içeren koleksiyonu Her işlem listesinde değil şu anda ayıklanacak veya olmayabilir. Şu anda ayıklanacak işlemlerin alt almak için DebuggedProcesses.
Örnekler
Aşağıdaki örnek, nasıl kullanılacağını gösterir LocalProcesses özelliği.
Bu özellik test etmek için:
- Hedef projeyi açın ve eklentiyi çalıştırın.
public static void LocalProcesses(EnvDTE80.DTE2 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("Local Processes
Test");
owp.Activate();
EnvDTE90.Debugger3 debugger = (EnvDTE90.Debugger3)dte.Debugger;
EnvDTE.Processes processes = debugger.LocalProcesses;
if (processes.Count == 0)
owp.OutputString("No processes are running on this machine.");
else
{
owp.OutputString("Processes running on this machine:");
foreach (EnvDTE90.Process2 proc in processes)
owp.OutputString("\nProcess: [" + proc.ProcessID + "] " +
proc.Name);
}
}
Sub AttachToCalc()
' This function attaches to calc.exe if it is running.
Dim attached As Boolean = False
Dim proc As EnvDTE.Process
For Each proc In DTE2.Debugger.LocalProcesses
If (Right(proc.Name, 8) = "calc.exe") Then
proc.Attach()
attached = True
Exit For
End If
Next
If attached = False Then
MsgBox("calc.exe is not running")
End If
End Sub
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. kısmen güvenilir kod tarafından Kitaplıklar kullanma.