语言

ProfilePropertySettings.Type 属性

定义

获取或设置动态生成的 ProfileCommon 类中关联属性的类型的名称。

public:
 property System::String ^ Type { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("type", DefaultValue="string")]
public string Type { get; set; }
[<System.Configuration.ConfigurationProperty("type", DefaultValue="string")>]
member this.Type : string with get, set
Public Property Type As String

属性值

有效、完全限定的类型引用或空字符串(“)。 默认值为空字符串。

属性

示例

下面的代码示例演示如何使用该 Type 属性。 该代码示例是 ProfileSection 类中的一个较大示例的一部分。

// Get the current Type property value.
Console.WriteLine(
    "Current Type value: '{0}'", profilePropertySettings.Type);

// Set the Type property to "System.DateTime".
profilePropertySettings.Type = "System.DateTime";
' Get the current Type property value.
Console.WriteLine( _
    "Current Type value: '{0}'", profilePropertySettings.Type)

' Set the Type property to "System.DateTime".
profilePropertySettings.Type = "System.DateTime"

注解

当设置为有效的类型引用时,此类型用于生成的 ProfileCommon 类中的命名属性。

类型引用的格式如下(不需要括号中的项): Namespace.Typename, Assemblyname[,] [Version=x,] [Culture=y,] [PublicKeyToken=z]

例如:

"ExampleNameSpace.ExampleType, Example.Assembly, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%"

适用于

另请参阅