Compartir a través de


CommandWindow.OutputString (Método)

Envía una cadena de texto a la ventana Comando.

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

Sintaxis

'Declaración
Sub OutputString ( _
    Text As String _
)
void OutputString(
    string Text
)
void OutputString(
    String^ Text
)
abstract OutputString : 
        Text:string -> unit
function OutputString(
    Text : String
)

Parámetros

  • Text
    Tipo: String

    Obligatorio. Caracteres de texto que se enviarán a la ventana.

Comentarios

OutputString no agrega automáticamente caracteres de nueva línea a la cadena. Si desea que la cadena tenga este tipo de caracteres, debe agregarlos al parámetro Text.

Ejemplos

Sub CommandWinExample(ByVal dte As DTE)
    ' Get a reference to the Command window.
    Dim win As Window = _
    DTE.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow)
    Dim CW As CommandWindow = win.Object

    ' Input a command into the Command window and execute it.
    CW.SendInput("nav https://www.microsoft.com", False)

    ' Insert some information text into the Command window.
    CW.OutputString("This URL takes you to the main Microsoft _
    website.")

    ' Clear the contents of the Command window.
    MsgBox("Clearing the Command window...")
    CW.Clear()
End Sub
void CommandWinExample(_DTE dte) 
{
    // Get a reference to the Command window.
    Window win =    
    dte.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow);
    CommandWindow CW = (CommandWindow)win.Object;

    // Input a command into the Command window and execute it.
    CW.SendInput("nav https://www.microsoft.com", false);

    // Insert some information text into the Command window.
    CW.OutputString("This URL takes you to the main Microsoft 
    website.");

    // Clear the contents of the Command window.
    MessageBox.Show("Clearing the Command window...");
    CW.Clear();
}

Seguridad de .NET Framework

Vea también

Referencia

CommandWindow Interfaz

EnvDTE (Espacio de nombres)

Otros recursos

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