ProfilePropertySettings.Type 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置动态生成的 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%"