Debugger2.LocalProcesses Özellik
Şu anda bu makinede çalışan işlemlerin listesini alır.
Ad alanı: EnvDTE80
Derleme: EnvDTE80 (EnvDTE80.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 koleksiyonu içeren bir işlem listesi çalışan bu makine. 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 sınamak 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();
EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)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 (EnvDTE80.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.