WebBrowser.Source 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置 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
属性值
当前 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" />
注解
设置源属性会导致null则会显示空白文档(“about:blank”)。