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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。