共用方式為


VCProjectEngineObjectClass.LoadProject 方法

載入專案。

命名空間:  Microsoft.VisualStudio.VCProjectEngine
組件:  Microsoft.VisualStudio.VCProjectEngine (在 Microsoft.VisualStudio.VCProjectEngine.dll 中)

語法

'宣告
Public Overridable Function LoadProject ( _
    projectName As String _
) As Object
public virtual Object LoadProject(
    string projectName
)
public:
virtual Object^ LoadProject(
    [InAttribute] String^ projectName
)
abstract LoadProject : 
        projectName:string -> Object  
override LoadProject : 
        projectName:string -> Object
public function LoadProject(
    projectName : String
) : Object

參數

  • projectName
    類型:String

    必要項。 專案名稱。

傳回值

類型:Object
VCProject 物件。

實作

VCProjectEngine.LoadProject(String)

備註

不要具現化 VCProjectEngineObjectClass。 具現化 VCProjectEngineObject ,如下所示:

Dim Engine As VCProjectEngine
Engine = New VCProjectEngineObject()

範例

' compile with /reference:Microsoft.VisualStudio.VCProjectEngine.dll
Option Strict Off
Imports Microsoft.VisualStudio.VCProjectEngine

Module Module1
Sub Main()
Dim Engine As VCProjectEngine
Dim Proj As VCProject
Dim Configs, Tools As IVCCollection
Dim Config As VCConfiguration
Dim LinkerTool As VCLinkerTool

Engine = New VCProjectEngineObject()
Proj = Engine.LoadProject("xx.vcproj")

Configs = Proj.Configurations
Config = Configs.Item(1)
Tools = Config.Tools

LinkerTool = Tools.Item("VCLinkerTool")
System.Console.WriteLine("Current value of ToolName: {0}", LinkerTool.ToolName)
Engine.RemoveProject("xx.vcproj")
End Sub
End Module

.NET Framework 安全性

請參閱

參考

VCProjectEngineObjectClass 類別

Microsoft.VisualStudio.VCProjectEngine 命名空間