VCFile.AddFile 方法

向当前项目或文件夹添加文件。

命名空间:  Microsoft.VisualStudio.VCProjectEngine
程序集:  Microsoft.VisualStudio.VCProjectEngine(在 Microsoft.VisualStudio.VCProjectEngine.dll 中)

语法

声明
Function AddFile ( _
    bstrPath As String _
) As Object
Object AddFile(
    string bstrPath
)
Object^ AddFile(
    String^ bstrPath
)
abstract AddFile : 
        bstrPath:string -> Object 
function AddFile(
    bstrPath : String
) : Object

参数

  • bstrPath
    类型:System.String
    必选。要添加到项目或文件夹中的文件的名称。

返回值

类型:System.Object
刚添加的文件的 VCFile 对象。

备注

VCProject 对象的AddFile 行为取决于文件扩展名。如果文件的扩展名指定与 Filter 属性,文件将添加到适当的文件夹。否则,这些文件放置在 解决方案资源管理器 层次结构的底部。

无论文件扩展名,在 VCFilter 对象的AddFile 在指定的文件夹导致文件中,。

添加文件此类不创建磁盘上的文件。调用方负责处理时,如果需要,。

VCFile 对象的AddFile 指定文件的名称与文件。

.NET Framework 安全性

请参见

参考

VCFile 接口

Microsoft.VisualStudio.VCProjectEngine 命名空间