开发者

How to open file programmatically using EnvDTE in C#

开发者 https://www.devze.com 2023-02-11 15:08 出处:网络
How to open f开发者_如何学运维ile programmatically using EnvDTE in C#.Assuming you have a hook to the correct DTE instance...

How to open f开发者_如何学运维ile programmatically using EnvDTE in C#.


Assuming you have a hook to the correct DTE instance...

DTE.ExecuteCommand("File.OpenFile", "c:\\derp.txt");


You can try the following snippet directly in the Visual Studio Console:

$DTE.ItemOperations.OpenFile("c:\derp.txt",$DTE.Constants.vsViewKindTextView)

It should open the file as long as it exists...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号