VCProjectReference.Culture 属性
获取选定的区域性引用。
命名空间: Microsoft.VisualStudio.VCProjectEngine
程序集: Microsoft.VisualStudio.VCProjectEngine(在 Microsoft.VisualStudio.VCProjectEngine.dll 中)
语法
声明
ReadOnly Property Culture As String
string Culture { get; }
property String^ Culture {
String^ get ();
}
abstract Culture : string with get
function get Culture () : String
属性值
类型:System.String
一个 enumResourceLangID 值。
示例
有关如何编译和运行此示例的信息,请参见 如何:编译项目模型扩展性示例代码 。
下面的代码示例在项目列表中的每一个 Culture 属性值引用:
[Visual Basic]
' Add a reference to Microsoft.VisualStudio.VCProjectEngine.
' This sample displays the build number of every file
' referenced in a Visual C++ project. Therefore, make sure
' you have a Visual C++ project with references loaded before
' running this code.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine
Public Module Module1
Sub Test()
Dim proj As Project
Dim vcproj As VCProject
Dim ref As VCReference
On Error Resume Next
' Loop each project in the solution.
For Each proj In DTE.Solution.Projects
vcproj = Nothing
vcproj = CType(proj.Object, VCProject)
' If this is a Visual C++ project.
If Not vcproj Is Nothing Then
' Loop each reference in the Visual C++ project.
For Each ref In vcproj.VCReferences
MsgBox("The culture for the file referenced by '" & _
ref.Name & "' is '" & ref.Culture & "'.")
Next
End If
Next
End Sub
End Module
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。