如何自动使用VS2008打开特定文件 [英] How to open a specific file with VS2008 automatically

查看:96
本文介绍了如何自动使用VS2008打开特定文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我有一个带有按钮的Windows窗体,为我打开VS2008,但是我想在VS2008中同时扩展该功能以打开一个特定的文件



Ok so I have a windows Form with a button on it to open VS2008 for me which it does, but I want to extend the function now to open a specific file at the same time in VS2008

private void btnReport_Click(object sender, EventArgs e)
        {
            Process openVisualStudio2008 = new Process();
            openVisualStudio2008.StartInfo.FileName = @"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe";
            openVisualStudio2008.Start();
        }

推荐答案

使用

Use
openVisualStudio2008.Arguments = @"c:\program.cs";

在<$之前c $ c> openVisualStudio2008.Start(); (当然用适当的文件名替换c:\ program.cs!)

before the openVisualStudio2008.Start(); (replacing "c:\program.cs" with your appropriate file name of course!)


这篇关于如何自动使用VS2008打开特定文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆