Solution4.Open(String) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
打开指定的解决方案。
public:
void Open(System::String ^ FileName);
public:
void Open(Platform::String ^ FileName);
void Open(std::wstring const & FileName);
[System.Runtime.InteropServices.DispId(17)]
public void Open (string FileName);
[<System.Runtime.InteropServices.DispId(17)>]
abstract member Open : string -> unit
Public Sub Open (FileName As String)
参数
- FileName
- String
必需。 要打开的解决方案文件的文件名。
实现
- 属性
示例
Sub SolnOpenExample(ByVal dte As DTE2)
' Open a solution.
Dim soln As Solution4 = CType(dte.Solution, Solution4)
' Try to open the solution.
Try
' Make sure you replace <file path>
' below with an actual path,
' and <solution.sln> with an actual solution file.
soln.Open("<file path>\<solution.sln>")
Catch ex As SystemException
MsgBox("ERROR: " & ex.ToString())
End Try
End Sub
using System.Windows.Forms;
public void SolnOpenExample(DTE2 dte)
{
// Open a solution.
try
{
Solution4 soln = (Solution4)_applicationObject.Solution;
// Make sure you replace <filepath> below
// with an actual path
// and <solution.sln> with an actual solution file.
soln.Open(@"<file path>\<solution.sln>");
}
catch (SystemException ex)
{
MessageBox.Show("ERROR: " + ex);
}
}