Aracılığıyla paylaş


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
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.

Notlar

LocalProcessesalır bir Processes bu bilgisayarda çalışan işlemlerin listesini içeren koleksiyonu.Listedeki her bir işlem olabilir veya değil şu anda Ayıklanacak.Şu anda Ayıklanacak işlemleri kümesini almak için kullanmak DebuggedProcesses.

Örnekler

Aşağıdaki örnek, nasıl kullanılacağını gösterir LocalProcesses özelliği.

Bu özellik test etmek için:

  1. 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

Ayrıca bkz.

Başvuru

Debugger3 Arabirim

LocalProcesses Fazla Yük

EnvDTE90 Ad Alanı