可以将Visual Studio(调试)输出窗口编程清除吗? [英] Can the Visual Studio (debug) Output window be programatically cleared?
本文介绍了可以将Visual Studio(调试)输出窗口编程清除吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以通过程序方式清除Visual Studio OUTPUT 窗口?例如,名为DebugView的SysInternal调试器应用程序具有具体命令DBGVIEWCLEAR ..清除日志窗口。
is it possible to have a way to clear the Visual Studio OUTPUT window, programatically? For example, the SysInternal's debugger app called DebugView has the specific command called DBGVIEWCLEAR .. which clears the log window.
请不要说:右键单击,清除窗口..用鼠标。我知道,但这不是我以后的事。
Please don't say: right-click, clear window .. with the mouse. I know that, but that's not what i'm after.
欢呼:)
推荐答案
对于VS 2008,尝试此代码
For VS 2008 try this code
EnvDTE80.DTE2 ide = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.9.0");
ide.ExecuteCommand("Edit.ClearOutputWindow", "");
System.Runtime.InteropServices.Marshal.ReleaseComObject(ide);
VisualStudio.DTE.9.0将从VS版本更改为版本。
"VisualStudio.DTE.9.0" will change from VS version to version.
这篇关于可以将Visual Studio(调试)输出窗口编程清除吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文