Solution4.Create(String, String) 方法

定义

在指定的目录中创建具有指定名称的空解决方案。

public:
 void Create(System::String ^ Destination, System::String ^ Name);
public:
 void Create(Platform::String ^ Destination, Platform::String ^ Name);
void Create(std::wstring const & Destination, std::wstring const & Name);
[System.Runtime.InteropServices.DispId(40)]
public void Create (string Destination, string Name);
[<System.Runtime.InteropServices.DispId(40)>]
abstract member Create : string * string -> unit
Public Sub Create (Destination As String, Name As String)

参数

Destination
String

必需。 要在其中创建 .sln 和 .suo(解决方案)文件的目录。

Name
String

必需。 要在 解决方案资源管理器 中显示的名称。 这也是 .sln 和 .suo 文件的基名称。

实现

属性

示例

Sub CreateExample(ByVal dte As DTE2)  
    ' Create a  solution.  
    Try  
        Dim soln As Solution4 =  _  
        CType(_applicationObject.Solution, Solution4)  
        MsgBox("Creating a new solution ")  
        ' Make sure that the file path below exists on your computer.  
        ' You can modify the path.  
        soln.Create("c:\temp2", "ANewSoln.sln")  
    Catch ex As System.Exception  
        MsgBox(ex.ToString)  
    End Try  
End Sub  
using System.Windows.Forms;  
public void CreateExample(DTE2 dte)  
{  
    // Create a solution.  
    try  
    {  
        Solution4 soln = (Solution4)_applicationObject.Solution;  
        MessageBox.Show("Creating a  solution ");  
        // Make sure that the file path below exists on your computer.  
        // You can modify the path.  
        soln.Create("c:\temp2", "ANewSoln2.sln");  
    }  
    catch(SystemException ex)  
    {  
    MessageBox.Show("ERROR: " + ex);  
    }  
}  

适用于