Udostępnij za pośrednictwem


Process3.Name Property

Gets the name of the process.

Namespace:  EnvDTE90
Assembly:  EnvDTE90 (in EnvDTE90.dll)

Syntax

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

Property Value

Type: System.String
A string that represents the name of the process.

Implements

Process2.Name

Examples

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

Public Module Module1

    Sub NativeAttachToLocalCalc()
        Dim dbg2 As EnvDTE90.Debugger3
        dbg2 = DTE.Debugger

        Dim attached As Boolean = False
        Dim proc As EnvDTE90.Process3
        For Each proc In DTE.Debugger.LocalProcesses
            If (Right(proc.Name, 8) = "calc.exe") Then
                proc.Attach2("native")
                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

.NET Framework Security

See Also

Reference

Process3 Interface

Name Overload

EnvDTE90 Namespace