ClientTarget.Alias 属性

定义

获取用户代理的别名。

public:
 property System::String ^ Alias { System::String ^ get(); };
[System.Configuration.ConfigurationProperty("alias", IsKey=true, IsRequired=true)]
[System.Configuration.StringValidator(MinLength=1)]
public string Alias { get; }
[<System.Configuration.ConfigurationProperty("alias", IsKey=true, IsRequired=true)>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.Alias : string
Public ReadOnly Property Alias As String

属性值

String

用于引用特定用户代理的名称。

属性

示例

下面的代码示例演示如何从现有 Web 应用程序的配置文件中获取 Alias 该配置文件。


// Get the first client target 
// in the collection.
clientTarget = clientTargets[0];

// Get the alias.
alias = clientTarget.Alias;

msg = String.Format(
      "Alias:      {0}\n",
      alias);
' Get the first client target 
' in the collection.
clientTarget = clientTargets(0)

' Get the alias.
aliasStr = clientTarget.Alias

msg = String.Format( _
"Alias:      {0}" + ControlChars.Lf, aliasStr)

注解

Alias属性引用alias配置文件节中clientTarget元素的属性add

ASP.NET 配置默认值包括以下别名:

  • uplevel,指示 ASP.NET 发送 Internet Explorer 6.0 及更高版本支持的 HTML 和 ECMAScript。

  • downlevel,它告知 ASP.NET 将 HTML 和脚本限制为早于 Internet Explorer 6.0 的浏览器支持的版本。

适用于

另请参阅