语言

WebBrowser.Source 属性

定义

获取或设置 Uri 托管在 . 中的 WebBrowser当前文档。

public:
 property Uri ^ Source { Uri ^ get(); void set(Uri ^ value); };
public Uri Source { [System.Security.SecurityCritical] get; set; }
public Uri Source { get; set; }
[<get: System.Security.SecurityCritical>]
member this.Source : Uri with get, set
member this.Source : Uri with get, set
Public Property Source As Uri

属性值

Uri

当前 HTML 文档的编号 Uri 。

特性

例外

实例 WebBrowser 不再有效。

无法检索对基础本机 WebBrowser 的引用。

从部分信任中运行的应用程序到 Uri 不在源站点上的导航。

示例

以下示例演示如何配置为 WebBrowser 仅使用标记导航到 HTML 文档。

<!-- Web Browser Control that hosts a web page. -->
<WebBrowser x:Name="webBrowser" Source="http://msdn.com"
  Width="600" Height="600"  />

注解

设置源属性会导致导航到由 <a0/a0> 指定的文档。 如果是,Urinull则会显示空白文档(“about:blank”)。

适用于