共用方式為


VCProject.Files 屬性

取得物件上的檔案集合。

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

語法

'宣告
ReadOnly Property Files As Object
Object Files { get; }
property Object^ Files {
    Object^ get ();
}
abstract Files : Object with get
function get Files () : Object

屬性值

型別:System.Object
檔案的集合。

範例

請參閱HOW TO:編譯專案模型擴充性的範例程式碼如需有關如何編譯及執行這個範例資訊。

下列範例會使用Files屬性在VCProject在整合式的開發環境 (IDE) 中的物件:

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim idx As Integer
        Dim prj As VCProject
        Dim mycollection As IVCCollection
        Dim myfile As VCFile

        prj = DTE.Solution.Projects.Item(1).Object
        mycollection = prj.Files
        MsgBox(mycollection.Count)
        For idx = 1 To mycollection.Count
            myfile = mycollection.Item(idx)
            ' myfile.Name has the name of the file
        Next
    End Sub
End Module

.NET Framework 安全性

請參閱

參考

VCProject 介面

Microsoft.VisualStudio.VCProjectEngine 命名空間