Compartir a través de


Process2.Name (Propiedad)

Obtiene el nombre del proceso.

Espacio de nombres:  EnvDTE80
Ensamblado:  EnvDTE80 (en EnvDTE80.dll)

Sintaxis

'Declaración
ReadOnly Default Property Name As String
    Get
string this { get; }
property String^ default {
    String^ get ();
}
abstract Name : string
function get Name () : String

Valor de propiedad

Tipo: System.String
Cadena que representa el nombre del proceso.

Implementaciones

Process.Name

Ejemplos

' Macro code.
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Imports Microsoft.VisualBasic.ControlChars

Public Module Module1

    Sub DefaultAttachToLocalCalc()
        Dim dbg2 As EnvDTE80.Debugger2
        dbg2 = DTE.Debugger

        Dim attached As Boolean = False
        Dim proc As EnvDTE80.Process2
        For Each proc In DTE.Debugger.LocalProcesses
            If (Right(proc.Name, 8) = "calc.exe") Then
                proc.Attach2()
                attached = True
                Exit For
            End If
        Next

        If attached = False Then
            If attached = False Then
                MsgBox("calc.exe isn't running")
            End If
        End If
    End Sub
End Module

Seguridad de .NET Framework

Vea también

Referencia

Process2 Interfaz

Name (Sobrecarga)

EnvDTE80 (Espacio de nombres)

Otros recursos

Cómo: Compilar y ejecutar los ejemplos de código del modelo de objetos de automatización