次の方法で共有


CommandWindow.OutputString メソッド

テキスト文字列をコマンド ウィンドウに送ります。

名前空間:  EnvDTE
アセンブリ:  EnvDTE (EnvDTE.dll 内)

構文

'宣言
Sub OutputString ( _
    Text As String _
)
void OutputString(
    string Text
)
void OutputString(
    String^ Text
)
abstract OutputString : 
        Text:string -> unit
function OutputString(
    Text : String
)

パラメーター

  • Text
    型 : String

    必須。 ウィンドウに送るテキスト文字。

解説

OutputString では、改行文字は文字列に自動的には追加されません。 改行文字を文字列に追加する場合は、Text に追加する必要があります。

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();
}

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

CommandWindow インターフェイス

EnvDTE 名前空間

その他の技術情報

方法 : オートメーション オブジェクト モデルのコード例をコンパイルおよび実行する